Let's say N have 3 factors.
1 and N will always be its 2 factors. So only 1 factor is left.
Now we need to take number P having only 1 factor > 1 and < P.
This number P can only be (prime)2.
So total squares of prime < 1000.
eg.
4 = 22 = Factors(1, 2, 4)
9 = 32 = Factors(1, 3, 9)
25 = 52 = Factors(1, 5, 25)
49 = 72 = Factors(1, 7, 49)
...
961 = 312 = Factors(1, 31, 961)
Till 312 are < 1000.
N = (22, 32, 52, 72, 92, 112, 132, 172, 192, 232, 292, 312)
Total numbers < 1000 with exactly 3 factors = 12