login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A125646
Smallest odd prime base q such that p^5 divides q^(p-1) - 1, where p = prime(n).
12
97, 487, 14557, 32261, 275393, 220861, 15541, 2342959, 1051847, 24639193, 40373093, 70697317, 31851901, 47289133, 456330179, 10000453, 154075723, 130702609, 304154189, 143584109, 183298237, 79451167, 1058782027, 352845203, 567620413, 4592184511, 5890772963, 9651540247, 4081988041, 4772484029
OFFSET
1,1
LINKS
MAPLE
f:= proc(n) local p, k, j, q, R;
p:= ithprime(n);
R:= sort(map(rhs@op, [msolve(q^(p-1)-1, p^5)]));
for k from 0 do
for j in R do
q:= k*p^5+j;
if isprime(q) then return q fi;
od
od
end proc:
map(f, [$1..100]); # Robert Israel, Apr 11 2019
MATHEMATICA
Do[p = Prime[n]; q = 2; While[PowerMod[q, p-1, p^5] != 1, q = NextPrime[q]]; Print[q], {n, 100}] (* Ryan Propper, Mar 31 2007 *)
PROG
(PARI) { a(n) = local(p, x, y); if(n==1, return(97)); p=prime(n); x=znprimroot(p^5)^(p^4); vecsort( vector(p-1, i, y=lift(x^i); while(!isprime(y), y+=p^5); y ) )[1] } \\ Max Alekseyev, May 30 2007
(Python)
from itertools import count
from sympy import nthroot_mod, isprime, prime
def A125646(n):
m = (p:=prime(n))**5
r = sorted(nthroot_mod(1, p-1, m, all_roots=True))
for i in count(0, m):
for a in r:
if isprime(i+a): return i+a # Chai Wah Wu, May 02 2024
KEYWORD
nonn
AUTHOR
Alexander Adamchuk, Nov 29 2006
EXTENSIONS
More terms from Ryan Propper, Mar 31 2007
More terms from Max Alekseyev, May 30 2007
STATUS
approved