OFFSET
1,1
COMMENTS
All terms are congruent to 5 mod 36.
For sequences of this type, once you get a(n) == 5, 11, 17, 23, 29, or 35 mod 36, all later terms stay in the same congruence class mod 36. Sequences in the same congruence class are likely to merge after a few terms. Thus with a(1) = 77 you get 77, 113, 149, 293, 617 and from then on it's the same as the present sequence. - Robert Israel, Sep 05 2014
LINKS
Harvey P. Dale, Table of n, a(n) for n = 1..1000
EXAMPLE
41 - 5 = 6^2, 617 - 41 = 24^2, 653 - 617 = 6^2.
MATHEMATICA
sps[n_]:=Module[{p=NextPrime[n]}, While[!IntegerQ[Sqrt[p-n]], p= NextPrime[ p]]; p]; NestList[sps, 5, 60] (* Harvey P. Dale, Jul 28 2016 *)
PROG
(PARI) print1(p=5", "); for(k=1, 100, x=1; while(!isprime(q=p+36*x^2), x=x+1); print1(q", "); p=q)
CROSSREFS
KEYWORD
nonn
AUTHOR
Zak Seidov, Sep 02 2014
STATUS
approved