OFFSET
1,1
COMMENTS
For n >= 2, a(n) == 1 or 9 (mod 10) and a(n)^2 + a(n+1)^2 is twice a prime.
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
EXAMPLE
a(2) = 19 because a(1) = 2 and 2^2 + 19^2 = 365 = 5 * 73 is a semiprime.
a(3) = 29 because 19^2 + 29^2 = 1202 = 2*601 is a semiprime.
MAPLE
R:= 2, 19: b:= 19^2: p:= 19: count:= 2:
while count < 100 do
p:= nextprime(p);
if isprime((b+p^2)/2) then
R:= R, p; count:= count+1; b:= p^2;
fi
od:
R;
MATHEMATICA
p = 3; s = {q = 2}; Do[While[2 != PrimeOmega[q^2 + p^2], p = NextPrime[p]]; AppendTo[s, q = p], {100}]; s
CROSSREFS
KEYWORD
nonn
AUTHOR
Zak Seidov and Robert Israel, Aug 28 2023
STATUS
approved