OFFSET
1,1
COMMENTS
Records of (A185103 restricted to primes). - Joerg Arndt, May 29 2017
MATHEMATICA
Function[s, Prime@ Position[s, #][[1, 1]] & /@ Union@ FoldList[Max, s]]@ Table[Function[p, b = 2; While[PowerMod[b, p - 1, p^2] != 1, b++]; b]@ Prime@ n, {n, 10^3}] (* Michael De Vlieger, May 21 2017 *)
PROG
(PARI) minb(n) = my(b=2); while(Mod(b, n^2)^(n-1)!=1, b++); b
my(r=0); forprime(p=1, , if(minb(p) > r, print1(p, ", "); r=minb(p)))
(Python)
from itertools import islice
from sympy import nextprime
from sympy.ntheory.residue_ntheory import nthroot_mod
def A287147_gen(): # generator of terms
c, p = 5, 3
yield 2
while True:
d = nthroot_mod(1, p-1, p**2, True)[1]
if d > c:
c = d
yield p
p = nextprime(p)
CROSSREFS
KEYWORD
nonn
AUTHOR
Felix Fröhlich, May 20 2017
STATUS
approved