OFFSET
0,3
COMMENTS
Any binary word has a unique factorization as a product of nonincreasing Lyndon words (see Lothaire). a(n) = number of factors in Lyndon factorization of binary expansion of n.
It appears that a(n) = k for the first time when n = 2^(k-1)+1.
We define the Lyndon product of two or more finite sequences to be the lexicographically maximal sequence obtainable by shuffling the sequences together. For example, the Lyndon product of (231) with (213) is (232131), the product of (221) with (213) is (222131), and the product of (122) with (2121) is (2122121). A Lyndon word is a finite sequence that is prime with respect to the Lyndon product. Equivalently, a Lyndon word is a finite sequence that is lexicographically strictly less than all of its cyclic rotations. Every finite sequence has a unique (orderless) factorization into Lyndon words, and if these factors are arranged in lexicographically decreasing order, their concatenation is equal to their Lyndon product. - Gus Wiseman, Nov 12 2019
REFERENCES
M. Lothaire, Combinatorics on Words, Addison-Wesley, Reading, MA, 1983. See Theorem 5.1.5, p. 67.
G. Melançon, Factorizing infinite words using Maple, MapleTech Journal, vol. 4, no. 1, 1997, pp. 34-42
LINKS
N. J. A. Sloane, Table of n, a(n) for n = 0..10000
N. J. A. Sloane, Maple programs for A211100 etc.
EXAMPLE
n=25 has binary expansion 11001, which has Lyndon factorization (1)(1)(001) with three factors, so a(25) = 3.
Here are the Lyndon factorizations for small values of n:
.0.
.1.
.1.0.
.1.1.
.1.0.0.
.1.01.
.1.1.0.
.1.1.1.
.1.0.0.0.
.1.001.
.1.01.0.
.1.011.
.1.1.0.0.
...
MATHEMATICA
lynQ[q_]:=Array[Union[{q, RotateRight[q, #]}]=={q, RotateRight[q, #]}&, Length[q]-1, 1, And];
lynfac[q_]:=If[Length[q]==0, {}, Function[i, Prepend[lynfac[Drop[q, i]], Take[q, i]]][Last[Select[Range[Length[q]], lynQ[Take[q, #]]&]]]];
Table[Length[lynfac[IntegerDigits[n, 2]]], {n, 0, 30}] (* Gus Wiseman, Nov 12 2019 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
N. J. A. Sloane, Mar 31 2012
STATUS
approved