# For any prime number $p$, let $A_p$ be the set of integers $d\in \{1,2,\dots, 999\}$ s. Then what is the cardinality of $A_p$?

For any prime number $p$, let $A_p$ be the set of integers $d\in \{1,2,\dots, 999\}$ such that the power of $p$ in the prime factorization of $d$ is odd. Then what is the cardinality of $A_p$?

I have used to the following result, but failed to show the required result.
The largest exponent $e$ of a prime $p$ such that $p^e$ is a divisor of $n!$ is given by $$e=\left\lfloor \dfrac{n}{p} \right\rfloor + \left\lfloor \dfrac{n}{p^2} \right\rfloor + \left\lfloor \dfrac{n}{p^3} \right\rfloor$$
How can I do next?

• If I've understood correctly, we have $|A_p|=0$ for $p>999$, right? – Sambo Aug 16 '18 at 20:29
• Please concoct a relevant title. – Did Aug 16 '18 at 21:55

The number of integers less than or equal to $n$ and divisible by $d$ is $\lfloor n/d \rfloor$. You need to count the number of integers divisible by $p$, minus the number of primes divisible by $p^2$, and so on...