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.

Showing 1-5 of 5 results.

A325549 Number of necklace compositions of n with distinct circular differences.

Original entry on oeis.org

1, 1, 2, 3, 5, 4, 10, 16, 23, 34, 53, 66, 113, 164, 262, 380, 567, 821, 1217, 1778, 2702, 3919, 5760, 8520, 12375
Offset: 1

Views

Author

Gus Wiseman, May 10 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.
The circular differences of a composition c of length k are c_{i + 1} - c_i for i < k and c_1 - c_i for i = k. For example, the circular differences of (1,2,1,3) are (1,-1,2,-2).

Examples

			The a(1) = 1 through a(8) = 16 necklace compositions:
  (1)  (2)  (3)   (4)    (5)    (6)    (7)     (8)
            (12)  (13)   (14)   (15)   (16)    (17)
                  (112)  (23)   (24)   (25)    (26)
                         (113)  (114)  (34)    (35)
                         (122)         (115)   (116)
                                       (124)   (125)
                                       (133)   (134)
                                       (142)   (143)
                                       (223)   (152)
                                       (1213)  (224)
                                               (233)
                                               (1124)
                                               (1142)
                                               (1214)
                                               (11213)
                                               (11312)
		

Crossrefs

Programs

  • Mathematica
    neckQ[q_]:=Array[OrderedQ[{q,RotateRight[q,#]}]&,Length[q]-1,1,And];
    Table[Length[Select[Join@@Permutations/@IntegerPartitions[n],neckQ[#]&&UnsameQ@@Append[Differences[#],First[#]-Last[#]]&]],{n,15}]

A325553 Number of compositions of n with distinct circular differences up to sign.

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 1, 7, 21, 31, 41, 87, 99, 191, 245, 381, 501, 735, 883, 1309, 1841, 2589, 3435, 4941, 6857, 9791, 13503, 19475, 27073, 37175, 52299, 72249, 100359, 139317, 190549, 256769, 355193, 471963, 644433, 858793, 1159161, 1530879, 2056073, 2711921
Offset: 0

Views

Author

Gus Wiseman, May 11 2019

Keywords

Comments

A composition of n is a finite sequence of positive integers summing to n.
The circular differences of a composition c of length k are c_{i + 1} - c_i for i < k and c_1 - c_i for i = k. For example, the circular differences of (1,2,1,3) are (1,-1,2,-2).

Examples

			The a(1) = 1 through a(8) = 21 compositions:
  (1)  (2)  (3)  (4)  (5)  (6)  (7)    (8)
                                (124)  (125)
                                (142)  (134)
                                (214)  (143)
                                (241)  (152)
                                (412)  (215)
                                (421)  (251)
                                       (314)
                                       (341)
                                       (413)
                                       (431)
                                       (512)
                                       (521)
                                       (1124)
                                       (1142)
                                       (1241)
                                       (1421)
                                       (2114)
                                       (2411)
                                       (4112)
                                       (4211)
		

Crossrefs

Programs

  • Mathematica
    Table[Length[Select[Join@@Permutations/@IntegerPartitions[n],UnsameQ@@Abs[Differences[Append[#,First[#]]]]&]],{n,20}]

Extensions

a(0) and a(26)-a(43) from Alois P. Heinz, Jan 28 2024

A325590 Number of necklace compositions of n with circular differences all equal to 1 or -1.

Original entry on oeis.org

0, 0, 1, 0, 1, 1, 1, 1, 2, 1, 2, 2, 2, 2, 4, 3, 3, 4, 4, 5, 7, 6, 7, 10, 10, 11, 15, 16, 18, 23, 25, 32, 38, 43, 53, 64, 73, 89, 108, 131, 153, 188, 223, 272, 329, 395, 475, 583, 697, 848, 1027, 1247, 1506, 1837, 2223, 2708, 3282, 3993, 4848, 5913, 7175, 8745, 10640
Offset: 1

Views

Author

Gus Wiseman, May 12 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.
The circular differences of a sequence c of length k are c_{i + 1} - c_i for i < k and c_1 - c_i for i = k. For example, the circular differences of (1,2,1,3) are (1,-1,2,-2).
Up to rotation, a(n) is the number of ways to arrange positive integers summing to n in a circle such that adjacent parts differ by 1 or -1.

Examples

			The first 16 terms count the following compositions:
   3: (12)
   5: (23)
   6: (1212)
   7: (34)
   8: (1232)
   9: (45)
   9: (121212)
  10: (2323)
  11: (56)
  11: (121232)
  12: (2343)
  12: (12121212)
  13: (67)
  13: (123232)
  14: (3434)
  14: (12121232)
  15: (78)
  15: (123432)
  15: (232323)
  15: (1212121212)
  16: (3454)
  16: (12321232)
  16: (12123232)
The a(21) = 7 necklace compositions:
  (10,11)
  (2,3,4,5,4,3)
  (3,4,3,4,3,4)
  (1,2,1,2,1,2,3,4,3,2)
  (1,2,3,2,1,2,3,2,3,2)
  (1,2,1,2,3,2,3,2,3,2)
  (1,2,1,2,1,2,1,2,1,2,1,2,1,2)
		

Crossrefs

Programs

  • Mathematica
    neckQ[q_]:=Array[OrderedQ[{q,RotateRight[q,#]}]&,Length[q]-1,1,And];
    Table[Length[Select[Join@@Permutations/@IntegerPartitions[n],neckQ[#]&&(SameQ[1,##]&@@Abs[Differences[Append[#,First[#]]]])&]],{n,15}]
  • PARI
    step(R,n,s)={matrix(n,n,i,j, if(i>j, if(j>s, R[i-j, j-s]) + if(j+s<=n, R[i-j, j+s])) )}
    a(n)={sum(k=1, n, my(R=matrix(n,n,i,j,i==j&&abs(i-k)==1), t=0, m=1); while(R, R=step(R,n,1); m++; t+=sumdiv(n, d, R[d,k]*d*eulerphi(n/d))/m ); t/n)} \\ Andrew Howroyd, Aug 23 2019

Extensions

a(26)-a(40) from Lars Blomberg, Jun 11 2019
Terms a(41) and beyond from Andrew Howroyd, Aug 23 2019

A325588 Number of necklace compositions of n with equal circular differences up to sign.

Original entry on oeis.org

1, 2, 3, 4, 4, 7, 5, 9, 8, 10, 8, 17, 9, 14, 15, 22, 12, 23, 14, 31, 23, 25, 19, 48, 25, 35, 36, 56, 33, 59, 43, 86, 64, 74, 76, 136, 95, 127, 138, 219, 178, 245, 249, 372, 370, 445, 506, 747, 730, 907, 1069, 1431, 1544, 1927, 2268, 2981, 3332, 4074, 4896, 6320
Offset: 1

Views

Author

Gus Wiseman, May 11 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.
The circular differences of a sequence c of length k are c_{i + 1} - c_i for i < k and c_1 - c_i for i = k. For example, the circular differences of (1,2,1,3) are (1,-1,2,-2).

Examples

			The a(1) = 1 through a(8) = 9 compositions:
  (1)  (2)   (3)    (4)     (5)      (6)       (7)        (8)
       (11)  (12)   (13)    (14)     (15)      (16)       (17)
             (111)  (22)    (23)     (24)      (25)       (26)
                    (1111)  (11111)  (33)      (34)       (35)
                                     (222)     (1111111)  (44)
                                     (1212)               (1232)
                                     (111111)             (1313)
                                                          (2222)
                                                          (11111111)
		

Crossrefs

Programs

  • Mathematica
    neckQ[q_]:=Array[OrderedQ[{q,RotateRight[q,#]}]&,Length[q]-1,1,And];
    Table[Length[Select[Join@@Permutations/@IntegerPartitions[n],neckQ[#]&&SameQ@@Abs[Differences[Append[#,First[#]]]]&]],{n,15}]
  • PARI
    step(R,n,s)={matrix(n, n, i, j, if(i>j, if(j>s, R[i-j, j-s]) + if(j+s<=n, R[i-j, j+s])) )}
    w(n,s)={sum(k=1, n, my(R=matrix(n,n,i,j,i==j&&abs(i-k)==s), t=0, m=1); while(R, R=step(R,n,s); m++; t+=sumdiv(n, d, R[d,k]*d*eulerphi(n/d))/m ); t/n)}
    a(n) = {numdiv(max(1,n)) + sum(s=1, n-1, w(n,s))} \\ Andrew Howroyd, Aug 24 2019

Extensions

Terms a(26) and beyond from Andrew Howroyd, Aug 24 2019

A325555 Number of necklace compositions of n with distinct differences up to sign.

Original entry on oeis.org

1, 2, 2, 4, 5, 6, 10, 15, 19, 24, 39, 49, 78, 106, 155, 207, 313, 430, 608, 867, 1239, 1670, 2313, 3220, 4483
Offset: 1

Views

Author

Gus Wiseman, May 11 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.
The differences of a sequence are defined as if the sequence were increasing, so for example the differences of (3,1,2) are (-2,1).

Examples

			The a(1) = 1 through a(8) = 15 necklace compositions:
  (1)  (2)   (3)   (4)    (5)    (6)    (7)     (8)
       (11)  (12)  (13)   (14)   (15)   (16)    (17)
                   (22)   (23)   (24)   (25)    (26)
                   (112)  (113)  (33)   (34)    (35)
                          (122)  (114)  (115)   (44)
                                 (132)  (124)   (116)
                                        (133)   (125)
                                        (142)   (134)
                                        (223)   (143)
                                        (1132)  (152)
                                                (224)
                                                (233)
                                                (1124)
                                                (1142)
                                                (1322)
		

Crossrefs

Programs

  • Mathematica
    neckQ[q_]:=Array[OrderedQ[{q,RotateRight[q,#]}]&,Length[q]-1,1,And];
    Table[Length[Select[Join@@Permutations/@IntegerPartitions[n],UnsameQ@@Abs[Differences[#]]&&neckQ[#]&]],{n,15}]
Showing 1-5 of 5 results.