OFFSET
1,2
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
MAPLE
R:= 1: cands:= [seq(i^2, i=2..10^6)]: nc:= 10^6-1: s:= 1: found:= true:
for n from 2 to 100 while found do
found:= false;
for j from 1 to nc do
if isprime(s+cands[j]) then
found:= true; R:= R, cands[j];
s:= s+cands[j];
cands:= subsop(j=NULL, cands);
break
fi
od od:
R; # Robert Israel, Apr 09 2023
PROG
(PARI) v=[1]; n=1; while(n<10^3, if(isprime(n^2+vecsum(v))&&!vecsearch(vecsort(v), n^2), v=concat(v, n^2); n=1); n++); v \\ Derek Orr, Jun 06 2015
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Amarnath Murthy, Aug 15 2002
EXTENSIONS
Corrected and extended by Antonio G. Astudillo (afg_astudillo(AT)lycos.com), Apr 24 2003
STATUS
approved