%I #23 Jan 08 2018 02:44:15
%S 2,7,29,71,73,251,773,827,937,1367,1549,5507,7489,8387,8513,10531,
%T 11969,16931,18413,18451,20753,21683,24113,25171,26813,27011,29633,
%U 33871,63473,76403,77261,89203,222161,229423,254993,266291,278353
%N a(1) = 2; a(n) is the smallest prime > a(n-1) such that a(n) + a(n-1) is a square.
%H Harry J. Smith and Zak Seidov, <a href="/A062064/b062064.txt">Table of n, a(n) for n = 1..10000</a> (first 1000 terms from Harry J. Smith)
%e The next term after 7 is 29 as 7 + 29 = 36 = 6^2.
%t nxt[n_]:=Module[{np=NextPrime[n]},While[!IntegerQ[Sqrt[n+np]],np = NextPrime[ np]]; np]; NestList[nxt,2,40] (* _Harvey P. Dale_, Apr 28 2013 *)
%t NestList[(n=Floor[Sqrt[2*#]]+1;While[!PrimeQ[q=n^2-#],n++];q)&,2,30](* _Zak Seidov_, Feb 15 2017 *)
%o (PARI) { a=2; for (n=1, 1000, a1=a; if (n>1, until (issquare(a + a1), a=nextprime(a + 1))); write("b062064.txt", n, " ", a) ) } \\ _Harry J. Smith_, Jul 31 2009
%Y Cf. A062066, A134537, A131696, A083016.
%K nonn,easy
%O 1,1
%A _Amarnath Murthy_, Jun 12 2001
%E More terms from Larry Reeves (larryr(AT)acm.org), Jun 21 2001
|