login
A383504
Sum of next a(n) successive prime squares is prime.
2
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,1
COMMENTS
Group the primes such that the sum of squares of members of each group is a prime, and each successive group is as short as possible.
Apart from a(1)=2, a(n) is odd and not a multiple of 3.
LINKS
EXAMPLE
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
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 *)
PROG
(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
CROSSREFS
Cf. A001248, A073684 (sum of successive primes), A384161 (sum of successive prime cubes).
Sequence in context: A106018 A188499 A215535 * A056921 A041245 A042159
KEYWORD
nonn
AUTHOR
Abhiram R Devesh, May 18 2025
STATUS
approved