Skip to content

KLyndonWords ​

The Lyndon words of length nn over a kk-letter alphabet: aperiodic necklaces, strictly less than every nontrivial rotation.

KLyndonWords(n, k)the Lyndon words of length nn over a kk-letter alphabet: aperiodic necklaces, strictly less than every nontrivial rotation
Typed signatures
TypePackageApplies
(integer<0..>, integer<0..>) -> indexed_collection<list<integer>>combinatoricsalways

Domain: Collections

Details
  • Count is 1n∑d∣nμ(d) kn/d\frac{1}{n}\sum_{d \mid n} \mu(d) \, k^{n/d}; specializes to LyndonWords at k=2k=2.

Enumeration

Examples

1 more kept as data, checked against the oracles
Basic #

Count(KLyndonWords(4,3))=18Count(KLyndonWords(4, 3)) = 18

live ↗
InCount(KLyndonWords(4,3))\mathrm{Count}(\mathrm{KLyndonWords}(4, 3))Out1818

The first element in enumeration order

live ↗
InKLyndonWords(4,3)[1]\mathrm{KLyndonWords}(4, 3)[1]Out[1,1,1,2]\bigl\lbrack1, 1, 1, 2\bigr\rbrack
About
Examples3
CrosswalkSageMath

See also: LyndonWords, KNecklaces