OFFSET
1,1
COMMENTS
LINKS
Wikipedia, Generalized Wieferich primes.
Robert G. Wilson v, Table of n, a(n) for n = 1..10000 (or 0 if unknown)
FORMULA
a(n) = A039951(prime(n)).
a(n) = 2 if and only if prime(n) == 1 (mod 4). [Jonathan Sondow, Aug 29 2010]
EXAMPLE
MATHEMATICA
f[n_] := Block[{b = Prime@ n, p = 2}, While[ PowerMod[b, p - 1, p^2] != 1, p = NextPrime@ p]; p]; Array[f, 14]
PROG
(PARI) forprime(a=2, 20, forprime(p=2, 10^9, if(Mod(a, p^2)^(p-1)==1, print1(p, ", "); next({2}))); print1("--, ")) \\ Felix Fröhlich, Jun 27 2014
CROSSREFS
KEYWORD
hard,more,nonn
AUTHOR
Jonathan Sondow, Mar 19 2010
STATUS
approved