OFFSET
1,2
COMMENTS
LINKS
Zak Seidov, Table of n, a(n) for n = 1..2000
EXAMPLE
1 is in the sequence because 1^2+2^2 = 5 and 2^2+3^2 = 13 are both prime.
4 is in the sequence because 4^2+5^2 = 41 and 5^2+6^2 = 61 are both prime.
MATHEMATICA
Reap[Do[If[PrimeQ[k^2+(k+1)^2]&&PrimeQ[(k+1)^2+(k+2)^2], Sow[k]], {k, 2000}]][[2, 1]]
Select[Range[2500], AllTrue[{#^2+(#+1)^2, (#+1)^2+(#+2)^2}, PrimeQ]&] (* The program uses the AllTrue function from Mathematica version 10 *) (* Harvey P. Dale, Feb 25 2017 *)
PROG
(PARI) s=[]; for(m=1, 2500, if(isprime(m^2+(m+1)^2) && isprime((m+1)^2+(m+2)^2), s=concat(s, m))); s \\ Colin Barker, Feb 21 2014
CROSSREFS
KEYWORD
nonn
AUTHOR
Zak Seidov, Feb 21 2014
STATUS
approved