OFFSET
1,1
COMMENTS
a(n) = least base b > 1 such that n is a Wieferich number (see A077816).
At least, b = n^2+1 can satisfy this equation, so a(n) is defined for all n.
Least Wieferich number (>1) to base n: 2, 1093, 11, 1093, 2, 66161, 4, 3, 2, 3, 71, 2693, 2, 29, 4, 1093, 2, 5, 3, 281, 2, 13, 4, 5, 2, ...; each is a prime or 4. It is 4 if and only if n mod 72 is in the set {7, 15, 23, 31, 39, 47, 63}.
Does every natural number (>1) appear in this sequence? If yes, do they appear infinitely many times?
LINKS
Eric Chen, Table of n, a(n) for n = 1..1000
EXAMPLE
a(30) = 107 since A000010(30) = 8, 30^2 = 900, and 107 is the least base b > 1 such that b^8 = 1 (mod 900).
MATHEMATICA
f[n_] := Block[{b = 2, m = EulerPhi[n]}, While[ PowerMod[b, m, n^2] != 1, b++]; b]; f[1] = 2; Array[f, 72] (* Robert G. Wilson v, Feb 28 2015 *)
PROG
(PARI) a(n)=for(k=2, 2^24, if((k^eulerphi(n))%(n^2)==1, return(k)))
CROSSREFS
KEYWORD
nonn
AUTHOR
Eric Chen, Feb 21 2015
STATUS
approved