Google Treasure Hunt 2008 Puzzle 4

April 14, 2009

Find the smallest number that can be expressed as the sum of 7 consecutive prime numbers, the sum of 17 consecutive prime numbers, the sum of 41 consecutive prime numbers, the sum of 541 consecutive prime numbers, and is itself a prime number.

Like this:

Related

6 Responses to “Google Treasure Hunt 2008 Puzzle 4”

Here is a solution that makes no assumptions about the size of the solution and does not compute unnecessary sums. The primes module provides a stream (as in SICP) of primes and the primitive prime?; push, pop, and dotimes are Scheme implementations of the like-named Common Lisp macros.

Would it be ok if I repost a few of your posts so long as I provide credit and
sources back to programmingpraxis.com? My website is on the exact same topic as yours and my visitors could undoubtedly learn from much of the articles you give here.
Feel free to let me know if this would be fine.
Cheers