Find the cardinality of the set $A_p$ defined as the following :

69 Views Asked by At

For any prime number $p$, $A_p$=the set of integers $d\in \{1,2,3,\dots, n\}$ such that the power of $p$ in the prime factorization of $d$ is odd. Then \begin{align*} A_p= & \lfloor\dfrac{n}{p}\rfloor-\lfloor\dfrac{n}{p^2}\rfloor+\lfloor\dfrac{n}{p^3}\rfloor-\lfloor\dfrac{n}{p^4}\rfloor+\dots \end{align*}

Any one can give me any idea how can I show this ?

Update:
I have gone through $1p,2p,3p,\dots, kp\leq n<(k+1)p\implies \lfloor \dfrac{n}{p}\rfloor=k$, but I can not understand after this step.