OFFSET
1,1
COMMENTS
All terms except 2 end in 1.
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
EXAMPLE
a(3) = 41 is a term because 41, 2*41+1 = 83 and (2*41)^2+(2*41+1)^2 = 13613 are prime.
MAPLE
filter:= proc(p) isprime(p) and isprime(2*p+1) and isprime(8*p^2+4*p+1) end proc:
select(filter, [2, seq(i, i=3..100000, 2)]);
MATHEMATICA
Select[Prime@ Range[5190], AllTrue[{# + 1, #^2 + (# + 1)^2}, PrimeQ] &[2 #] &] (* Michael De Vlieger, Aug 18 2021 *)
PROG
(Python)
from sympy import isprime, primerange
def ok(p): return isprime(2*p+1) and isprime((2*p)**2 + (2*p+1)**2)
print(list(filter(ok, primerange(1, 50592)))) # Michael S. Branicky, Aug 18 2021
(PARI) isok(p) = isprime(p) && isprime(2*p+1) && isprime(8*p^2+4*p+1); \\ Michel Marcus, Aug 18 2021
CROSSREFS
KEYWORD
nonn
AUTHOR
J. M. Bergot and Robert Israel, Aug 18 2021
STATUS
approved