login
Numbers n such that the sum of the primes <= n is a square.
4

%I #17 Apr 03 2023 10:36:09

%S 23,22073,67187,79427,10729219,3531577135439

%N Numbers n such that the sum of the primes <= n is a square.

%H G. L. Honaker Jr. and C. Caldwell, <a href="https://t5k.org/curios/page.php?curio_id=179">Prime Curios!: 9</a>

%H G. L. Honaker Jr. and C. Caldwell, <a href="https://t5k.org/curios/page.php?curio_id=12250">Prime Curios!: 3531577135439</a>

%H C. Riveras, PrimePuzzles.Net, <a href="http://www.primepuzzles.net/puzzles/puzz_009.htm">Problem 9: Sum of first k primes is perfect square</a>

%F a(n) = Prime(A033997(n))

%e 2+3+5+7+11+13+17+19+23 = 10^2 is a square, so 23 is in the sequence.

%t Prime[#]&/@Flatten[Position[Accumulate[Prime[Range[710000]]],_?(IntegerQ[ Sqrt[#]]&)]] (* This program will generate the first 5 terms of the sequence. *) (* _Harvey P. Dale_, Jun 22 2013 *)

%o (PARI) s=0;forprime(p=2,1e6,if(issquare(s+=p),print1(p", "))) \\ _Charles R Greathouse IV_, Feb 01 2013

%Y Cf. A000040, A033997, A061888, A061890.

%K nonn

%O 1,1

%A Calculated by _Jud McCranie_

%E 3531577135439 from _Giovanni Resta_, May 27 2003

%E Edited by _Ray Chandler_, Mar 20 2007