VOOZH about

URL: https://oeis.org/A389785

⇱ A389785 - OEIS


login
A389785
Least prime p such that (2^n*p)^2+1 is also prime, or 0 if no such p exists.
1
2, 2, 5, 2, 11, 5, 11, 2, 59, 67, 5, 5, 29, 13, 19, 7, 101, 17, 19, 157, 151, 3, 11, 47, 41, 103, 5, 7, 239, 73, 269, 23, 5, 7, 79, 103, 41, 97, 29, 5, 269, 73, 11, 223, 499, 107, 139, 97, 11, 127, 19, 23, 269, 877, 139, 307, 229, 43, 421, 7, 241, 23, 181, 23, 109
OFFSET
0,1
EXAMPLE
a(0)=2 because (2^0*2)^2+1 = 5 is prime.
a(1)=2 because (2^1*2)^2+1 = 17 is prime.
a(2)=5 because (2^2*5)^2+1 = 401 is prime.
a(4)=11 because (2^4*11)^2+1 = 30977 is prime.
MAPLE
nn:=10^5:
for n from 0 to 65 do:
ii:=0:
for k from 1 to nn while (ii=0) do:
p:=ithprime(k):
if isprime((2^n*p)^2+1) then ii:=1:printf(`%d, `, p):
else fi :
od:
if ii=0 then printf(`%d, `, 0):
else fi:
od:
MATHEMATICA
a[n_]:=Module[{p = 2, p2=2^n}, While[!PrimeQ[(p2*p)^2 + 1], p=NextPrime[p]]; p ]; Array[a, 65, 0] (* James C. McMahon, Oct 20 2025 *)
PROG
(PARI) a(n) = my(p=2); while (!isprime((2^n*p)^2+1), p=nextprime(p+1)); p; \\ Michel Marcus, Oct 15 2025
CROSSREFS
Cf. A002263 (where a(k)=5).
Sequence in context: A051612 A083456 A211932 * A213642 A344753 A353860
KEYWORD
nonn
AUTHOR
Michel Lagneau, Oct 14 2025
STATUS
approved