OFFSET
0,3
COMMENTS
For a set S = {x, y} (x < y), let f(S) = {2x, y - x}, then a(n) is the smallest k > 0 such that f_k({1, 2n}) = {1, 2n} where f_k(S) denotes iteration for k times. E.g., for n = 3 we have: f_1({1, 6}) = f({1, 6}) = {2, 5}, f_2({1, 6}) = f({2, 5}) = {3, 4}, f_3({1, 6}) = f({3, 4}) = {1, 6}. - Jianing Song, Jan 27 2019
From Jianing Song, Dec 24 2022: (Start)
Let psi = A002322. For n > 0, we have 4^(psi(2*n+1)/2) = 2^psi(2*n+1) == 1 (mod 2*n+1), so a(n) divides psi(2*n+1)/2 => a(n) <= psi(2*n+1)/2 <= n. a(n) = psi(2*n+1)/2 if and only if one of the two following conditions holds: (a) the multiplicative order of 2 modulo 2*n+1 is psi(2*n+1); (b) the multiplicative order of 2 modulo 2*n+1 is psi(2*n+1)/2, and psi(2*n+1) == 2 (mod 4).
Additionally, a(n) = n if and only if 2*n+1 = p is a prime, and one of the two following conditions holds: (a) 2 is a primitive root modulo p; (b) p == 3 (mod 4), and the multiplicative order of 2 modulo p is (p-1)/2 (in this case, we have p == 7 (mod 8) since 2 is a quadratic residue modulo p). Such primes p are listed in A216371. (End)
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 0..1000
Eric Weisstein's World of Mathematics, Multiplicative Order
FORMULA
Let b = A002326, then a(n) = b(n) if b(n) is odd, otherwise a(n) = b(n)/2. - Joerg Arndt, Feb 03 2019
MATHEMATICA
Table[ MultiplicativeOrder[4, n], {n, 1, 160, 2}] (* Robert G. Wilson v, Apr 05 2011 *)
PROG
(Magma) [1] cat [Modorder(4, 2*n+1): n in [1..100]]; // Vincenzo Librandi, Apr 01 2014
(PARI) a(n) = znorder(Mod(4, 2*n+1)); \\ Michel Marcus, Feb 05 2015
(GAP) List([0..80], n->OrderMod(4, 2*n+1)); # Muniru A Asiru, Feb 25 2019
CROSSREFS
KEYWORD
nonn
AUTHOR
STATUS
approved