OFFSET
1,3
COMMENTS
From Jinyuan Wang, Mar 25 2020: (Start)
For n > 2, n < a(n) < q^(n-1), where q is a prime factor of n - 1.
If p is a prime, then a(p^e+1) is divisible by p. Proof: we can prove that p | m for m > 1 and n = p^e + 1. If n^m == 1 (mod m) and m > 1 is the minimum value that cannot be divisible by p, then gcd(m, eulerphi(m)) = 1. Thus, m must be of the form q*p_2*...*p_k, where q < p_2 < ... < p_k. Note that q | (n^m - 1) = (n^q - 1)*(Sum_{i=0..(m/q)-1} n)^(i*q)) and n^q - 1 can never be divisible by q. Therefore, Sum_{i=0..(m/q)-1} n^(i*q) == n^(m/q) - 1 == 0 (mod q). Because n^(q-1) == 1 (mod q) and gcd(m/q, q - 1) = 1, then n == 1 (mod q), a contradiction! (End)
a(38) <= 14948925257859919. - Giovanni Resta, Apr 15 2020
LINKS
OEIS Wiki, 2^n mod n
FORMULA
a(n) = A333432(n,n).
PROG
(PARI) {a(n) = if(n==2, 0, my(cnt=0, k=0); while(cnt<n, k++; if(Mod(n, k)^k==1, cnt++)); k)}
CROSSREFS
KEYWORD
nonn,more
AUTHOR
Seiichi Manyama, Mar 21 2020
EXTENSIONS
a(30)-a(37) from Giovanni Resta, Apr 15 2020
STATUS
approved