This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A125646 #20 May 02 2024 17:33:24 %S A125646 97,487,14557,32261,275393,220861,15541,2342959,1051847,24639193, %T A125646 40373093,70697317,31851901,47289133,456330179,10000453,154075723, %U A125646 130702609,304154189,143584109,183298237,79451167,1058782027,352845203,567620413,4592184511,5890772963,9651540247,4081988041,4772484029 %N A125646 Smallest odd prime base q such that p^5 divides q^(p-1) - 1, where p = prime(n). %H A125646 Robert Israel, <a href="/A125646/b125646.txt">Table of n, a(n) for n = 1..500</a> %H A125646 W. Keller and J. Richstein, <a href="http://www1.uni-hamburg.de/RRZ/W.Keller/FermatQuotient.html">Fermat quotients that are divisible by p</a>. %p A125646 f:= proc(n) local p,k,j,q,R; %p A125646 p:= ithprime(n); %p A125646 R:= sort(map(rhs@op, [msolve(q^(p-1)-1, p^5)])); %p A125646 for k from 0 do %p A125646 for j in R do %p A125646 q:= k*p^5+j; %p A125646 if isprime(q) then return q fi; %p A125646 od %p A125646 od %p A125646 end proc: %p A125646 map(f, [$1..100]); # _Robert Israel_, Apr 11 2019 %t A125646 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 *) %o A125646 (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 %o A125646 (Python) %o A125646 from itertools import count %o A125646 from sympy import nthroot_mod, isprime, prime %o A125646 def A125646(n): %o A125646 m = (p:=prime(n))**5 %o A125646 r = sorted(nthroot_mod(1,p-1,m,all_roots=True)) %o A125646 for i in count(0,m): %o A125646 for a in r: %o A125646 if isprime(i+a): return i+a # _Chai Wah Wu_, May 02 2024 %Y A125646 Cf. A125609, A125610, A125611, A125612, A125632, A125633, A125634, A125635, A125636, A125637, A125645, A125647, A125648, A125649. %K A125646 nonn %O A125646 1,1 %A A125646 _Alexander Adamchuk_, Nov 29 2006 %E A125646 More terms from _Ryan Propper_, Mar 31 2007 %E A125646 More terms from _Max Alekseyev_, May 30 2007