OFFSET
1,5
COMMENTS
Note that a(n)>0 because k=1 is always a solution. The primes for which a(n)>1 are given in A134307. The values of k are the terms <p in row n of A143548. The largest known terms in this sequence are for the Wieferich primes 1093 and 3511, for which we have a(183)=11 and a(490)=12, respectively. It is not hard to show that k=p-1 is never a solution for odd prime p. In fact, (p-1)^(p-1)=p+1 (mod p^2) for odd prime p.
LINKS
T. D. Noe, Table of n, a(n) for n=1..10000
MATHEMATICA
Table[p=Prime[n]; s=Select[Range[p-1], PowerMod[ #, p-1, p^2]==1&]; Length[s], {n, 100}]
CROSSREFS
KEYWORD
nonn
AUTHOR
T. D. Noe, Sep 02 2008
STATUS
approved