login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A249807
a(0) = 1; afterwards a(n) is the smallest positive square that added to all previous terms produces a prime.
1
1, 1, 1, 4, 4, 36, 36, 144, 36, 324, 324, 36, 36, 36, 144, 144, 144, 36, 36, 36, 900, 900, 900, 324, 900, 36, 324, 36, 324, 576, 324, 144, 36, 324, 36, 576, 144, 2304, 576, 36, 144, 900, 324, 144, 576, 324, 900, 36, 144, 900, 2916, 144, 2916, 36, 576, 900, 1764, 324, 144, 1296, 36, 36
OFFSET
0,4
COMMENTS
All terms starting with a(5) are multiples of 36.
a(n) exists for all n under the Hardy-Littlewood Conjecture F. - Charles R Greathouse IV, Nov 06 2014
LINKS
Charles R Greathouse IV, Table of n, a(n) for n = 0..10000
EXAMPLE
1+1+1+4=7(prime), 7+4=11(prime), 11+36=47(prime), 47+36=83(prime).
MATHEMATICA
nxt[{t_, a_}]:=Module[{k=1}, While[!PrimeQ[t+k^2], k++]; {t+k^2, k^2}]; NestList[nxt, {1, 1}, 70][[;; , 2]] (* Harvey P. Dale, Jul 28 2023 *)
PROG
(PARI) first(n)=n=max(n, 5); my(v=vector(n+1, i, 1), k, s=11); v[4]=v[5]=4; for(i=6, #v, k=6; while(!isprime(s+k^2), k+=6); s+=v[i]=k^2); v \\ Charles R Greathouse IV, Nov 06 2014
CROSSREFS
Cf. A073609.
Sequence in context: A145109 A181858 A227511 * A180064 A105350 A335183
KEYWORD
nonn,easy
AUTHOR
Zak Seidov, Nov 06 2014
STATUS
approved