%I #23 Dec 14 2016 13:21:44
%S 1,1,1,1,1,1,2,1,2,1,4,1,2,2,1,1,1,2,6,1,2,4,10,1,4,2,6,2,3,1,4,1,4,1,
%T 2,2,6,6,2,1,4,2,6,4,2,10,11,1,6,4,1,2,12,6,4,2,6,3,28,1,4,4,2,1,2,4,
%U 10,1,10,2,12,2,6,6,4,6,4,2,12,1,18,4,20,2,1,6
%N Least common eventual period of a^(2^k) mod n for all a.
%C a(n) is a divisor of phi(phi(n)) (A010554).
%H Ivan Neretin, <a href="/A256608/b256608.txt">Table of n, a(n) for n = 1..10000</a>
%H Haifeng Xu, <a href="http://arxiv.org/abs/1601.06509">The largest cycles consist by the quadratic residues and Fermat primes</a>, arXiv:1601.06509 [math.NT], 2016.
%F a(n) = A007733(A002322(n)).
%F a(prime(n)) = A037178(n). - _Michel Marcus_, Jan 27 2016
%e In other words, eventual period of {0..n-1} under the map x -> x^2 mod n.
%e 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.
%e 0 1 2 3 4 5 6 7 8 9
%e 0 1 4 9 6 5 6 9 4 1
%e 0 1 6 1 6 5 6 1 6 1
%e 0 1 6 1 6 5 6 1 6 1
%e and thus every number reaches a fixed point. This means the eventual common period is 1, hence a(10)=1.
%t 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 *)
%o (PARI) rpsi(n) = lcm(znstar(n)[2]); \\ A002322
%o pb(n) = znorder(Mod(2, n/2^valuation(n, 2))); \\ A007733
%o a(n) = pb(rpsi(n)); \\ _Michel Marcus_, Jan 28 2016
%Y Cf. A001146, A002322, A002326, A007733, A010554, A037178.
%Y First differs from A256607 at n=43.
%Y LCM of entries in row n of A279185.
%K nonn
%O 1,7
%A _Ivan Neretin_, Apr 04 2015
|