Is there any other reliable method of finding whether a number is prime or not than the traditional method?
The system of dividing a number by all the primes less than its square root is too time consuming.
Say, in 10200, when you want to find the number of primes between a certain range. If I precalculate the number,the program works fine, but if I calculate within the program, then it gets TLE always, though in my pc I don't have to wait for the output more than 1 or 2 sec.
I hate to get AC by hard coding..so I wanna know that if there are other methods to find a number's primarility quickly...or this type of problem should always be solved by pre-generating???
The time limit of this program is 10 sec...
If someone knows such method, please let me know...
Razib

