%I #24 Jul 13 2024 12:31:18
%S 2,6,8,14,20,90,102,154,228,310,418,554,1070,1224,3144,3996,4464,
%T 16194,17096,36642,122346
%N Numbers k such that 2^k + prime(k)^2 is prime.
%C All terms are even since 2^k + prime(k)^2 == 0 (mod 3) for any odd number k. - _Robert G. Wilson v_, Apr 03 2006
%C If k is odd, prime(k) == +- 1 (mod 3) making prime(k)^2 == 1 (mod 3) and 2^k == - 1 (mod 3). - _Robert G. Wilson v_, Apr 03 2006
%C No more terms below 150000. - _Michael S. Branicky_, Jul 13 2024
%e 20 is in the sequence because the 20th prime is 71 and 2^20 + 71^2 = 1053617 is prime.
%p a:=proc(n) if isprime(2^n+ithprime(n)^2) then n else fi end: seq(a(n),n=1..1300); # _Emeric Deutsch_, Apr 06 2006
%t Do[ If[ PrimeQ[2^n + Prime[n]^2], Print[n]], {n, 20000}] (* _Robert G. Wilson v_, Apr 03 2006 *)
%o (PARI) for(i=1,3000,if(isprime(2^i+prime(i)^2),print1(i,",")))
%K nonn,more
%O 1,1
%A Mohammed Bouayoun (mohammed.bouayoun(AT)sanef.com), Apr 03 2006
%E a(15)-a(19) from _Robert G. Wilson v_ and _Giovanni Resta_, Apr 03 2006
%E a(20) from _Michael S. Branicky_, Feb 10 2023
%E a(21) from _Michael S. Branicky_, Jul 12 2024