OFFSET
1,2
COMMENTS
Consider the function f(n) = the number of positive integers k < n such that k^n (mod n) == 1. This sequence lists the values of n at which f(n) reaches a new maximum.
All powers of two are present except its square. f(2^n) (with exception noted) = 2^(n-1) = 2^n/2.
All powers of two multiplied by 100, 1000 and 100000, but not 10000, are also present.
Terms other than the above are 27, 54, 243, 486, 500, 972, 1944, 3888, 4624, 7776, 9248, 12100, 12500, 15552, 18496, 24200, 25000, 31104, 36992, 48400, 50000, ..., .
Conjecture: f(x)/x -> 5/12.
LINKS
Robert G. Wilson v, Table of n, a(n) for n = 1..94
MATHEMATICA
f[n_] := (d = If[ OddQ@ n, 1, 2]; d*Length@ Select[ Range[ n/d], PowerMod[#, n, n] == 1 &]); f[1] = 1; k = 1; mx = 0; lst = {}; While[k < 10000001, a = f@ k; If[a > mx, mx = a; AppendTo[lst, k]; Print[{a, k}]]; k++]; lst
CROSSREFS
KEYWORD
nonn
AUTHOR
Robert G. Wilson v, Dec 18 2014
STATUS
approved