TITLE: The number of positive integers less than 1000 with an odd number of divisors
QUESTION [11 upvotes]: How many positive integers less than 1000 have an odd number of positive integer divisors?

Well I know that the number has to be composite because a prime number has 2 divisors, which are 1 and itself. I don't have any other thoughts to solve this problem other than brute force, which will take a long time and is not accurate. Any help? Thanks.

REPLY [4 votes]: If we allow division by 1 and by the number it self then all the prime numbers have exactly two divisors so we can discount all the prime numbers.
Now consider the composite numbers that are not a perfect square say 6. This is 1x6 or 2x3 so we can discount all these too.
Finally we consider the composite numbers that are perfect squares say 4. This is 1x4 or 2x2. It is therefore divisible by an odd number of factors.  This is true for all perfect squares and since the square root of 1000 is just over 31.6 there will be 31 natural numbers less than 1000 that have an odd number of factors
$1^2 = 1$, $2^2 = 4$, $3^2 = 9$, ... $31^2 = 961$