<s>[INST] Prove that $N - \lfloor{N/p}\rfloor = \lfloor{\frac{p-1}{p}\left({N + 1}\right)}\rfloor$ for positive $N$ and prime $p$ I am counting the number of positive integers less than or equal to some positive integer $N$ and not divisible by some prime $p$.  This gets generalized for $k$ primes where I use the principle of inclusion-exclusion for this result. The simple result for a single prime is $N - \lfloor{\frac{N}{p}}\rfloor$.  However, I have noticed by experiment that this is also equal to $\lfloor{\frac{p-1}{p} \left({N + 1}\right)}\rfloor$.  I am looking for a proof of this relation if true.
 [/INST] let 
$$
f(N) = N - \lfloor \frac{N}{p} \rfloor
$$
then
$$
f(N+1) - f(N) = 1 - \bigg(\lfloor \frac{N+1}{p} \rfloor - \lfloor \frac{N}{p} \rfloor  \bigg) 
$$
thus when $N$ is incremented by 1, $f(N)$ is also incremented by 1 except  when $N \equiv_p -1$. in this case $f(N+1) = f(N)$
if now we let
$$
g(N) = \lfloor{\frac{p-1}{p} \left({N + 1}\right)}\rfloor
$$
a little rearrangement gives
$$
g(N) = \lfloor N+1 - \frac{N+1}p \rfloor= N+1 + \lfloor -\frac{N+1}p \rfloor
$$
and
$$
g(N+1) - g(N) = 1 + \bigg(\lfloor -\frac{N+2}{p} \rfloor - \lfloor -\frac{N+1}{p} \rfloor  \bigg) 
$$
since $N$ is positive we again find that when $N$ increases by 1 the increment of $g$ is 1 except when $N \equiv_p -1$. 
since $f(1)=g(1)=1$ the result is demonstrated
</s>