<s>[INST] How many positive integers less than or equal to $500$ have exactly $3$ positive divisors? 
How many positive integers less than or equal to $500$ have exactly $3$ positive divisors?

My approach was to use the following inequality $N \leqslant 500$, where $N$ is the number of positive integers that have exactly $3$ positive divisors. Prime factorizing $500$ one would get that $500 = 2^2 \cdot 5^3$. Wouldn't this imply that $N$ would have to be of the form $N = 2^a \cdot 5^b$ and from the given condition we would get that $(a+1)(b+1) = 3$? However I couldn't get this any further. Any tips would be appreciated.
 [/INST] For $n$ to have exactly $3$ positive divisors, $1$ must be a factor, $n$ must be a factor and also we need another factor say $p$.
We need $\frac{n}{p}=p$ and $p$ is a prime. Prime is needed or additional divisors exists.
Hence $n$ must be a prime square.
Since $\sqrt{500}\approx 22.3$, the numbers are $2^2, 3^2, 5^2, 7^2, 11^2, 13^2, 17^2, 19^2$.
</s>