Saturday, February 16, 2013

project euler problem 010, very interesting problem

If you can solve problem 7, there is no difficulty to solve this one.  This can be a very simple problem using the sieve method.

But if you are really interested to count the primes or count the sum of primes under N, the sieve method is not efficient at all when N is large. In the discussion of this problem, a dynamic programming approach is suggested and it is a fast method to count prime numbers. Please do not miss the opportunity to learn if you do not know this method! The code is written in python,  and lucy did an excellent job in his post!

No comments:

Post a Comment