OFFSET
1,1
LINKS
G. C. Greubel, Table of n, a(n) for n = 1..10000
FORMULA
a(n) = 1 + A068501(n). - Zak Seidov, Feb 10 2015
EXAMPLE
2 is in the sequence because 2^2 + 1^2 = 5 and 2^2 - 1^2 = 3 are both prime.
3 is in the sequence because 3^2 + 2^2 = 13 and 3^2 - 2^2 = 5 are both prime.
MATHEMATICA
lst={}; Do[If[PrimeQ[n^2-(n-1)^2]&&PrimeQ[n^2+(n-1)^2], AppendTo[lst, n]], {n, 7!}]; lst
Select[Range[8!], PrimeQ[#^2 -(#-1)^2] && PrimeQ[#^2 +(#-1)^2] &] (* G. C. Greubel, Jan 28 2019 *)
PROG
(PARI) A178659()={my(maxx=1000); n=2; ptr=0;
while(n<=maxx, q1=n^2-(n-1)^2; q2=n^2+(n-1)^2;
if(isprime(q1)&&isprime(q2), ptr++; write("b178659.txt", ptr, " ", n)); n++); } \\ Bill McEachen, Jun 13 2014
CROSSREFS
KEYWORD
nonn
AUTHOR
Vladimir Joseph Stephan Orlovsky, Jun 01 2010
STATUS
approved