login
A393248
a(n) is the period length of the Ducci sequence, where the initial vector consists of the binary digits of n.
0
1, 1, 1, 3, 3, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 1, 6, 6, 6, 3, 3, 6, 6, 6, 6, 6, 1, 6, 6, 3, 6, 6, 6, 3, 6, 6, 6, 6, 3, 6, 3, 6, 6, 6, 6, 6, 6, 1, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7
OFFSET
1,4
FORMULA
Let A_k = {a(n) | 2^(k-1) <= n < 2^k}. Then max(A_k) = A038553(k) and #A_k = A111944(k). - Andrei Zabolotskii, Feb 14 2026
EXAMPLE
n = 6: 6_10 = 110_2, vectors are (1,1,0)-->(0,1,1)-->(1,0,1)-->(1,1,0) repeats after 3 steps, thus a(6) = 3.
n = 7: 7_10 = 111_2, vectors are (1,1,1)-->(0,0,0)-->(0,0,0) repeats after 1 step, thus a(7) = 1.
MATHEMATICA
a[n_] := Length[#] - FirstPosition[#, Last[#]][[1]]& @ NestWhileList[Abs[# - RotateLeft[#]] &, IntegerDigits[n, 2], Unequal, All]; Array[a, 80] (* Amiram Eldar, Feb 07 2026 *)
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Ctibor O. Zizka, Feb 07 2026
STATUS
approved