Can you help me in understanding the approach of this problem

I have seen couple of solutions(link text), but both of them trying to pre-populate initial 170 prime numbers. I don’t understand why.

I was thinking of basic idea.

a) First I shall calculate all primes which is less than the square root of the given number

b) Will try to divide that given number by all this primes.

Not sure how do I calculate the (a) part since number is huge. Any help would be great.