All about flooble | fun stuff | Get a free chatterbox | Free JavaScript | Avatars    
perplexus dot info

Home > Numbers
Sum of primes is a square (Posted on 2012-06-29) Difficulty: 3 of 5
Let's define S(k) = p1 + p2 + ... + pk, i.e. "the sum of the first k primes"
The sum of the first 9 consecutive prime numbers equals 100, a square number.

Find all k (below 9999) that will similarly produce perfect squares.

See The Solution Submitted by Ady TZIDON    
Rating: 5.0000 (1 votes)

Comments: ( Back to comment list | You must be logged in to post comments.)
Solution computer solution with an extension | Comment 1 of 2

Extended just far enough to get one more example beyond the range asked for:

   10   for I=1 to 999999
   20      P=nxtprm(P):Sum=Sum+P
   30      Sr=int(sqrt(Sum)+0.5)
   40      if Sr*Sr=Sum then print I,P,Sum,Sr
   50   next

finds

    k                p(k)               S(k)     sqrt(S(k))
    9                  23                  100          10
 2474               22073             25633969        5063
 6694               67187            212372329       14573
 7785               79427            292341604       17098
 709838          10729219        3672424151449     1916357

  Posted by Charlie on 2012-06-29 16:04:50
Please log in:
Login:
Password:
Remember me:
Sign up! | Forgot password


Search:
Search body:
Forums (0)
Newest Problems
Random Problem
FAQ | About This Site
Site Statistics
New Comments (6)
Unsolved Problems
Top Rated Problems
This month's top
Most Commented On

Chatterbox:
Copyright © 2002 - 2024 by Animus Pactum Consulting. All rights reserved. Privacy Information