cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A325786 Number of complete necklace compositions of n.

Original entry on oeis.org

1, 1, 2, 2, 4, 7, 12, 19, 41, 71, 141, 255, 509, 924, 1882, 3395, 6838, 12715, 25233, 47049
Offset: 1

Views

Author

Gus Wiseman, May 22 2019

Keywords

Comments

A necklace composition of n is a finite sequence of positive integers summing to n that is lexicographically minimal among all of its cyclic rotations. A circular subsequence is a sequence of consecutive terms where the first and last parts are also considered consecutive. A necklace composition of n is complete if every positive integer from 1 to n is the sum of some circular subsequence.

Examples

			The a(1) = 1 through a(8) = 19 necklace compositions:
  (1)  (11)  (12)   (112)   (113)    (123)     (124)      (1124)
             (111)  (1111)  (122)    (132)     (142)      (1133)
                            (1112)   (1113)    (1114)     (1142)
                            (11111)  (1122)    (1123)     (1214)
                                     (1212)    (1132)     (1223)
                                     (11112)   (1213)     (1322)
                                     (111111)  (1222)     (11114)
                                               (11113)    (11123)
                                               (11122)    (11132)
                                               (11212)    (11213)
                                               (111112)   (11222)
                                               (1111111)  (11312)
                                                          (12122)
                                                          (111113)
                                                          (111122)
                                                          (111212)
                                                          (112112)
                                                          (1111112)
                                                          (11111111)
		

Crossrefs

Programs

  • Mathematica
    neckQ[q_]:=Array[OrderedQ[{q,RotateRight[q,#]}]&,Length[q]-1,1,And];
    subalt[q_]:=Union[ReplaceList[q,{_,s__,_}:>{s}],DeleteCases[ReplaceList[q,{t___,,u___}:>{u,t}],{}]];
    Table[Length[Select[Join@@Permutations/@IntegerPartitions[n],neckQ[#]&&Union[Total/@subalt[#]]==Range[n]&]],{n,15}]