A383504 Sum of next a(n) successive prime squares is prime.
2, 5, 7, 25, 11, 13, 7, 7, 35, 7, 19, 31, 25, 11, 5, 19, 5, 11, 5, 139, 37, 17, 19, 19, 13, 5, 7, 7, 19, 13, 11, 5, 7, 11, 5, 5, 5, 13, 47, 43, 5, 23, 13, 11, 11, 79, 31, 35, 5, 5, 25, 5, 37, 95, 31, 13, 43, 17, 5, 35, 17, 23, 11, 41, 59, 7, 47, 5, 13, 7, 11
Offset: 1
Keywords
Examples
Primes, their squares, and the lengths of blocks which sum to a prime begin, primes 2, 3, 5, 7, 11, 13, 17, 19, ... squared 4, 9, 25, 49, 121, 169, 289, 361, ... \--/ \-------------------/ \--- ... sum 13 653 a(n) = 2 5
Links
- Abhiram R Devesh, Table of n, a(n) for n = 1..10000
Programs
-
Maple
i:= 0: p:= 0: t:= 0: count:= 0: R:= NULL: while count < 100 do p:= nextprime(p); i:= i+1; t:= t + p^2; if isprime(t) then R:= R, i; count:= count+1; i:= 0; t:= 0; fi od: R; # Robert Israel, May 25 2025
-
Mathematica
p=1;s={};Do[c=0;sm=0;While[!PrimeQ[sm],sm=sm+Prime[p]^2;p++;c++];AppendTo[s,c],{n,71}];s (* James C. McMahon, Jun 09 2025 *)
-
Python
from itertools import count, islice from sympy import isprime, nextprime def agen(): # generator of terms s, i, p = 0, 1, 2 while True: while not(isprime(s:=s+p**2)): i, p = i+1, nextprime(p) yield i s, i, p = 0, 1, nextprime(p) print(list(islice(agen(), 71))) # Michael S. Branicky, May 23 2025
Comments