OFFSET
0,1
LINKS
Robert Israel, Table of n, a(n) for n = 0..1654
EXAMPLE
For n = 2, 2*n+1 = 5, and 53 is the least prime q such that q^5 == 5 (mod 2^5), so a(2) = 53.
MAPLE
f:= proc(k) local x, m;
for m from subs(msolve(x^k=k, 2^k), x) by 2^k do
if isprime(m) then return m fi
od
end proc:
seq(f(2*i+1), i=0..50);
PROG
(PARI) a(n) = my(p=2); while (Mod(p, 2^(2*n+1))^(2*n+1) != 2*n+1, p = nextprime(p+1)); p; \\ Michel Marcus, Dec 16 2020
(Python)
from itertools import count
from sympy import nthroot_mod, isprime
def A339758(n):
m = (n<<1)+1
r = 1<<m
a = sorted(nthroot_mod(m, m, r, all_roots=True))
for i in count(0):
for k in a:
if isprime(k+i*r):
return int(k+i*r) # Chai Wah Wu, May 07 2024
CROSSREFS
KEYWORD
nonn
AUTHOR
J. M. Bergot and Robert Israel, Dec 16 2020
STATUS
approved