Euler 035 - counting circular primes
How many circular primes (primes that when rotated are still primes) are there below one million?
See Problem 20.
Again, this rescues a lot of code from previous problems, but the solution is less than perfect. The Euler guidelines say that every problem should be computable within a minute, but despite much tweaking, this solution takes significantly longer.
For speed, primes should be generated only once …