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.

A328600 Number of necklace compositions of n with no part circularly followed by a divisor.

Original entry on oeis.org

0, 0, 0, 0, 1, 0, 2, 1, 3, 5, 5, 7, 10, 18, 20, 29, 40, 58, 78, 111, 156, 218, 304, 429, 604, 859, 1209, 1726, 2423, 3462, 4904, 7000, 9953, 14210, 20270, 28979, 41391, 59253, 84799, 121539, 174162, 249931, 358577, 515090, 739932, 1063826, 1529766, 2201382, 3168565
Offset: 1

Views

Author

Gus Wiseman, Oct 25 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.
Circularity means the last part is followed by the first.

Examples

			The a(5) = 1 through a(13) = 18 necklace compositions (empty column not shown):
  (2,3)  (2,5)  (3,5)  (2,7)    (3,7)      (2,9)    (5,7)      (4,9)
         (3,4)         (4,5)    (4,6)      (3,8)    (2,3,7)    (5,8)
                       (2,4,3)  (2,3,5)    (4,7)    (2,7,3)    (6,7)
                                (2,5,3)    (5,6)    (3,4,5)    (2,11)
                                (2,3,2,3)  (2,4,5)  (3,5,4)    (3,10)
                                                    (2,3,2,5)  (2,4,7)
                                                    (2,3,4,3)  (2,6,5)
                                                               (2,8,3)
                                                               (3,6,4)
                                                               (2,3,5,3)
		

Crossrefs

The non-necklace version is A328598.
The version with singletons is A318729.
The case forbidding multiples as well as divisors is A328601.
The non-necklace, non-circular version is A328460.
The version for co-primality (instead of divisibility) is A328602.
Necklace compositions are A008965.
Partitions with no part followed by a divisor are A328171.

Programs

  • Mathematica
    neckQ[q_]:=Array[OrderedQ[{q,RotateRight[q,#]}]&,Length[q]-1,1,And];
    Table[Length[Select[Join@@Permutations/@IntegerPartitions[n],neckQ[#]&&And@@Not/@Divisible@@@Partition[#,2,1,1]&]],{n,10}]
  • PARI
    b(n, q, pred)={my(M=matrix(n, n)); for(k=1, n, M[k, k]=pred(q, k); for(i=1, k-1, M[i, k]=sum(j=1, k-i, if(pred(j, i), M[j, k-i], 0)))); M[q,]}
    seq(n)={my(v=sum(k=1, n, k*b(n, k, (i,j)->i%j<>0))); vector(n, n, sumdiv(n, d, eulerphi(d)*v[n/d])/n)} \\ Andrew Howroyd, Oct 26 2019

Formula

a(n) = A318729(n) - 1.

Extensions

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

A328601 Number of necklace compositions of n with no part circularly followed by a divisor or a multiple.

Original entry on oeis.org

0, 0, 0, 0, 1, 0, 2, 1, 2, 5, 4, 7, 6, 13, 14, 20, 30, 38, 50, 68, 97, 132, 176, 253, 328, 470, 631, 901, 1229, 1709, 2369, 3269, 4590, 6383, 8897, 12428, 17251, 24229, 33782, 47404, 66253, 92859, 130141, 182468, 256261, 359675, 505230, 710058, 997952, 1404214
Offset: 1

Views

Author

Gus Wiseman, Oct 25 2019

Keywords

Comments

A necklace composition of n (A008965) is a finite sequence of positive integers summing to n that is lexicographically minimal among all of its cyclic rotations.
Circularity means the last part is followed by the first.

Examples

			The a(5) = 1 through a(13) = 6 necklace compositions (empty column not shown):
  (2,3)  (2,5)  (3,5)  (2,7)  (3,7)      (2,9)  (5,7)      (4,9)
         (3,4)         (4,5)  (4,6)      (3,8)  (2,3,7)    (5,8)
                              (2,3,5)    (4,7)  (2,7,3)    (6,7)
                              (2,5,3)    (5,6)  (3,4,5)    (2,11)
                              (2,3,2,3)         (3,5,4)    (3,10)
                                                (2,3,2,5)  (2,3,5,3)
                                                (2,3,4,3)
		

Crossrefs

The non-necklace version is A328599.
The case forbidding divisors only is A328600 or A318729 (with singletons).
The non-necklace, non-circular version is A328508.
The version for co-primality (instead of indivisibility) is A328597.

Programs

  • Mathematica
    neckQ[q_]:=Array[OrderedQ[{q,RotateRight[q,#]}]&,Length[q]-1,1,And];
    Table[Length[Select[Join@@Permutations/@IntegerPartitions[n],neckQ[#]&&And@@Not/@Divisible@@@Partition[#,2,1,1]&&And@@Not/@Divisible@@@Reverse/@Partition[#,2,1,1]&]],{n,10}]
  • PARI
    b(n, q, pred)={my(M=matrix(n, n)); for(k=1, n, M[k, k]=pred(q, k); for(i=1, k-1, M[i, k]=sum(j=1, k-i, if(pred(j, i), M[j, k-i], 0)))); M[q,]}
    seq(n)={my(v=sum(k=1, n, k*b(n, k, (i,j)->i%j<>0 && j%i<>0))); vector(n, n, sumdiv(n, d, eulerphi(d)*v[n/d])/n)} \\ Andrew Howroyd, Oct 26 2019

Formula

a(n) = A318730(n) - 1.

Extensions

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

A328597 Number of necklace compositions of n where every pair of adjacent parts (including the last with the first) is relatively prime.

Original entry on oeis.org

1, 1, 2, 3, 5, 8, 12, 21, 33, 57, 94, 167, 279, 491, 852, 1507, 2647, 4714, 8349, 14923, 26642, 47793, 85778, 154474, 278322, 502715, 908912, 1646205, 2984546, 5418652, 9847189, 17916000, 32625617, 59470539, 108493149, 198094482, 361965238, 661891579, 1211162270
Offset: 1

Views

Author

Gus Wiseman, Oct 23 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.

Examples

			The a(1) = 1 through a(7) = 12 necklace compositions:
  (1)  (1,1)  (1,2)    (1,3)      (1,4)        (1,5)          (1,6)
              (1,1,1)  (1,1,2)    (2,3)        (1,1,4)        (2,5)
                       (1,1,1,1)  (1,1,3)      (1,2,3)        (3,4)
                                  (1,1,1,2)    (1,3,2)        (1,1,5)
                                  (1,1,1,1,1)  (1,1,1,3)      (1,1,1,4)
                                               (1,2,1,2)      (1,1,2,3)
                                               (1,1,1,1,2)    (1,1,3,2)
                                               (1,1,1,1,1,1)  (1,2,1,3)
                                                              (1,1,1,1,3)
                                                              (1,1,2,1,2)
                                                              (1,1,1,1,1,2)
                                                              (1,1,1,1,1,1,1)
		

Crossrefs

The non-necklace version is A328609.
The non-necklace non-circular version is A167606.
The version with singletons is A318728.
The aperiodic case is A318745.
The indivisible (instead of coprime) version is A328600.
The non-coprime (instead of coprime) version is A328602.
Necklace compositions are A008965.

Programs

  • Mathematica
    neckQ[q_]:=Array[OrderedQ[{q,RotateRight[q,#]}]&,Length[q]-1,1,And];
    Table[Length[Select[Join@@Permutations/@IntegerPartitions[n],neckQ[#]&&And@@CoprimeQ@@@Partition[#,2,1,1]&]],{n,10}]
  • PARI
    b(n, q, pred)={my(M=matrix(n, n)); for(k=1, n, M[k, k]=pred(q, k); for(i=1, k-1, M[i, k]=sum(j=1, k-i, if(pred(j, i), M[j, k-i], 0)))); M[q,]}
    seq(n)={my(v=sum(k=1, n, k*b(n, k, (i,j)->gcd(i,j)==1))); vector(n, n, sumdiv(n, d, eulerphi(d)*v[n/d])/n)} \\ Andrew Howroyd, Oct 26 2019

Formula

a(n > 1) = A318728(n) - 1.

Extensions

Terms a(21) and beyond from Andrew Howroyd, Oct 26 2019

A328669 Number of Lyndon compositions of n where every pair of adjacent parts (including the last with the first) is relatively prime.

Original entry on oeis.org

1, 0, 1, 2, 4, 6, 11, 18, 31, 52, 93, 157, 278, 479, 846, 1486, 2646, 4675, 8348, 14864, 26629, 47699, 85777, 154289, 278317, 502436, 908879, 1645712, 2984545, 5417742, 9847188, 17914493, 32625522, 59467892, 108493133, 198089609, 361965237, 661883230, 1211161990
Offset: 1

Views

Author

Gus Wiseman, Oct 26 2019

Keywords

Comments

A Lyndon composition of n is a finite sequence of positive integers summing to n that is lexicographically strictly less than all of its cyclic rotations.

Examples

			The a(1) = 1 through a(8) = 18 Lyndon compositions (empty column not shown):
  (1)  (12)  (13)   (14)    (15)     (16)      (17)
             (112)  (23)    (114)    (25)      (35)
                    (113)   (123)    (34)      (116)
                    (1112)  (132)    (115)     (125)
                            (1113)   (1114)    (134)
                            (11112)  (1123)    (143)
                                     (1132)    (152)
                                     (1213)    (1115)
                                     (11113)   (1214)
                                     (11212)   (1232)
                                     (111112)  (11114)
                                               (11123)
                                               (11132)
                                               (11213)
                                               (11312)
                                               (111113)
                                               (111212)
                                               (1111112)
		

Crossrefs

The non-Lyndon version is A328609 or A318748 (with singletons).
The non-Lyndon non-circular version is A167606.
The version with singletons is A318745.
The necklace case is A328597 or A318728 (with singletons).
The aperiodic case is A328670.
Lyndon compositions are A059966, with relatively prime case A318731.

Programs

  • Mathematica
    aperQ[q_]:=Array[RotateRight[q,#]&,Length[q],1,UnsameQ];
    neckQ[q_]:=Array[OrderedQ[{q,RotateRight[q,#]}]&,Length[q]-1,1,And];
    Table[Length[Select[Join@@Permutations/@IntegerPartitions[n],aperQ[#]&&neckQ[#]&&And@@CoprimeQ@@@Partition[#,2,1,1]&]],{n,10}]
  • PARI
    b(n, q, pred)={my(M=matrix(n, n)); for(k=1, n, M[k, k]=pred(q, k); for(i=1, k-1, M[i, k]=sum(j=1, k-i, if(pred(j, i), M[j, k-i], 0)))); M[q, ]}
    seq(n)={my(v=sum(k=1, n, k*b(n, k, (i, j)->gcd(i, j)==1))); vector(n, n, sumdiv(n, d, moebius(d)*v[n/d])/n)} \\ Andrew Howroyd, Nov 01 2019

Formula

a(n > 1) = A318745(n) - 1.

A328670 Number of aperiodic compositions of n where every pair of adjacent parts (including the last with the first) is relatively prime.

Original entry on oeis.org

1, 0, 2, 5, 11, 20, 41, 75, 147, 272, 533, 976, 1881, 3490, 6616, 12378, 23405, 43781, 82536, 154709, 291043, 546139, 1026685, 1927038, 3621004, 6798417, 12770935, 23980791, 45042957, 84584416, 158863805, 298336153, 560302805, 1052234995, 1976157456, 3711209272
Offset: 1

Views

Author

Gus Wiseman, Oct 29 2019

Keywords

Comments

A sequence is aperiodic if all of its cyclic rotations are different.

Examples

			The a(1) = 1 through a(6) = 20 compositions (empty column not shown):
  (1)  (12)  (13)   (14)    (15)
       (21)  (31)   (23)    (51)
             (112)  (32)    (114)
             (121)  (41)    (123)
             (211)  (113)   (132)
                    (131)   (141)
                    (311)   (213)
                    (1112)  (231)
                    (1121)  (312)
                    (1211)  (321)
                    (2111)  (411)
                            (1113)
                            (1131)
                            (1311)
                            (3111)
                            (11112)
                            (11121)
                            (11211)
                            (12111)
                            (21111)
		

Crossrefs

The non-aperiodic version is A328609 or A318748 (with singletons).
The non-aperiodic, non-circular version is A167606.
The Lyndon word case is A328669.
Lyndon compositions are A059966, with relatively prime case A318731.

Programs

  • Mathematica
    aperQ[q_]:=Array[RotateRight[q,#]&,Length[q],1,UnsameQ];
    Table[Length[Select[Join@@Permutations/@IntegerPartitions[n],aperQ[#]&&And@@CoprimeQ@@@Partition[#,2,1,1]&]],{n,10}]
  • PARI
    b(n, q, pred)={my(M=matrix(n, n)); for(k=1, n, M[k, k]=pred(q, k); for(i=1, k-1, M[i, k]=sum(j=1, k-i, if(pred(j, i), M[j, k-i], 0)))); M[q, ]}
    seq(n)={my(v=sum(k=1, n, b(n, k, (i, j)->gcd(i, j)==1))); vector(n, n, sumdiv(n, d, moebius(d)*v[n/d]))} \\ Andrew Howroyd, Nov 01 2019

Extensions

Terms a(21) and beyond from Andrew Howroyd, Nov 01 2019
Showing 1-5 of 5 results.