OFFSET
1,7
COMMENTS
a(n) is a divisor of phi(phi(n)) (A010554).
LINKS
Ivan Neretin, Table of n, a(n) for n = 1..10000
Haifeng Xu, The largest cycles consist by the quadratic residues and Fermat primes, arXiv:1601.06509 [math.NT], 2016.
FORMULA
a(prime(n)) = A037178(n). - Michel Marcus, Jan 27 2016
EXAMPLE
In other words, eventual period of {0..n-1} under the map x -> x^2 mod n.
For example, with n=10 the said map acts as follows. Read down the columns: the column headed 2 for example means that (repeatedly squaring mod 10), 2 goes to 4 goes to 16 = 6 (mod 10) goes to 36 = 6 mod 10 --- and has reached a fixed point.
0 1 2 3 4 5 6 7 8 9
0 1 4 9 6 5 6 9 4 1
0 1 6 1 6 5 6 1 6 1
0 1 6 1 6 5 6 1 6 1
and thus every number reaches a fixed point. This means the eventual common period is 1, hence a(10)=1.
MATHEMATICA
a[n_] := With[{lambda = CarmichaelLambda[n]}, MultiplicativeOrder[2, lambda / (2^IntegerExponent[lambda, 2])]]; Table[a[n], {n, 1, 100}] (* Jean-François Alcover, Jan 28 2016 *)
PROG
(PARI) rpsi(n) = lcm(znstar(n)[2]); \\ A002322
pb(n) = znorder(Mod(2, n/2^valuation(n, 2))); \\ A007733
a(n) = pb(rpsi(n)); \\ Michel Marcus, Jan 28 2016
CROSSREFS
KEYWORD
nonn
AUTHOR
Ivan Neretin, Apr 04 2015
EXTENSIONS
Name changed by Jianing Song, Feb 02 2025
STATUS
approved