Skip to content

KNecklaces ​

The words of length nn over a kk-letter alphabet up to rotation, represented by the lexicographically-least word in each orbit.

KNecklaces(n, k)the words of length nn over a kk-letter alphabet up to rotation, represented by the lexicographically-least word in each orbit
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} \varphi(d) \, k^{n/d}; specializes to BinaryNecklaces at k=2k=2.

Enumeration

Examples

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

Count(KNecklaces(4,3))=24Count(KNecklaces(4, 3)) = 24

live ↗
InCount(KNecklaces(4,3))\mathrm{Count}(\mathrm{KNecklaces}(4, 3))Out2424

The first element in enumeration order

live ↗
InKNecklaces(4,3)[1]\mathrm{KNecklaces}(4, 3)[1]Out[1,1,1,1]\bigl\lbrack1, 1, 1, 1\bigr\rbrack
Scope #

Exact past 2532^{53}: 3-color necklaces of 41 beads

live ↗
InCount(KNecklaces(41,3))\mathrm{Count}(\mathrm{KNecklaces}(41, 3))Out889 585 277 491 970 403889\,585\,277\,491\,970\,403

Known value · OEIS A001867 b-file

Properties #

The 3-color necklaces of nn beads, n=0…17n = 0 \dots 17

live ↗
InMap(n↦Count(KNecklaces(n,3)),0..1..17)\mathrm{Map}(n↦\mathrm{Count}(\mathrm{KNecklaces}(n, 3)), 0..1..17)Out[1,3,6,11,24,51,130,315,834,2 195,5 934,16 107,44 368,122 643,341 802,956 635,2 690 844,7 596 483]\bigl\lbrack1, 3, 6, 11, 24, 51, 130, 315, 834, 2\,195, 5\,934, 16\,107, 44\,368, 122\,643, 341\,802, 956\,635, 2\,690\,844, 7\,596\,483\bigr\rbrack

Known value · OEIS A001867

About
Examples5
CrosswalkSageMathSymPy

See also: BinaryNecklaces, KLyndonWords