%I #18 Aug 20 2021 04:27:43
%S 2,11,41,281,641,761,1451,1481,1811,2741,3821,4211,4481,5441,5501,
%T 7121,7691,7901,8111,9791,10061,10331,11171,12011,13451,15401,16001,
%U 16421,17351,17981,18041,27281,28961,30851,31151,32561,33941,35111,36191,43391,43691,43721,45131,45641,49331,49811,50411,50591
%N Primes p such that 2*p+1 and (2*p)^2+(2*p+1)^2 are also prime.
%C All terms except 2 end in 1.
%H Robert Israel, <a href="/A347110/b347110.txt">Table of n, a(n) for n = 1..10000</a>
%e a(3) = 41 is a term because 41, 2*41+1 = 83 and (2*41)^2+(2*41+1)^2 = 13613 are prime.
%p filter:= proc(p) isprime(p) and isprime(2*p+1) and isprime(8*p^2+4*p+1) end proc:
%p select(filter, [2,seq(i,i=3..100000,2)]);
%t Select[Prime@ Range[5190], AllTrue[{# + 1, #^2 + (# + 1)^2}, PrimeQ] &[2 #] &] (* _Michael De Vlieger_, Aug 18 2021 *)
%o (Python)
%o from sympy import isprime, primerange
%o def ok(p): return isprime(2*p+1) and isprime((2*p)**2 + (2*p+1)**2)
%o print(list(filter(ok, primerange(1, 50592)))) # _Michael S. Branicky_, Aug 18 2021
%o (PARI) isok(p) = isprime(p) && isprime(2*p+1) && isprime(8*p^2+4*p+1); \\ _Michel Marcus_, Aug 18 2021
%Y Intersection of A005384 and A103776.
%K nonn
%O 1,1
%A _J. M. Bergot_ and _Robert Israel_, Aug 18 2021