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-9 of 9 results.

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

Original entry on oeis.org

1, 0, 0, 0, 0, 2, 0, 4, 2, 7, 12, 11, 22, 26, 55, 63, 99, 149, 215, 324, 458, 699, 1006, 1492, 2185, 3202, 4734, 6928, 10242, 14951, 22023, 32365, 47557, 69905, 102633, 150983, 221712, 325918, 478841, 703647, 1034103, 1519431, 2233061, 3281003, 4821790, 7085358
Offset: 0

Views

Author

Gus Wiseman, Oct 24 2019

Keywords

Comments

A composition of n is a finite sequence of positive integers summing to n.
Circularity means the last part is followed by the first.

Examples

			The a(5) = 2 through a(12) = 22 compositions (empty column not shown):
  (2,3)  (2,5)  (3,5)  (2,7)    (3,7)      (2,9)    (5,7)
  (3,2)  (3,4)  (5,3)  (4,5)    (4,6)      (3,8)    (7,5)
         (4,3)         (5,4)    (6,4)      (4,7)    (2,3,7)
         (5,2)         (7,2)    (7,3)      (5,6)    (2,7,3)
                       (2,4,3)  (2,3,5)    (6,5)    (3,2,7)
                       (3,2,4)  (2,5,3)    (7,4)    (3,4,5)
                       (4,3,2)  (3,2,5)    (8,3)    (3,5,4)
                                (3,5,2)    (9,2)    (3,7,2)
                                (5,2,3)    (2,4,5)  (4,3,5)
                                (5,3,2)    (4,5,2)  (4,5,3)
                                (2,3,2,3)  (5,2,4)  (5,3,4)
                                (3,2,3,2)           (5,4,3)
                                                    (7,2,3)
                                                    (7,3,2)
                                                    (2,3,2,5)
                                                    (2,3,4,3)
                                                    (2,5,2,3)
                                                    (3,2,3,4)
                                                    (3,2,5,2)
                                                    (3,4,3,2)
                                                    (4,3,2,3)
                                                    (5,2,3,2)
		

Crossrefs

The necklace version is A328600, or A318729 without singletons.
The version with singletons is A318726.
The non-circular version is A328460.
Also forbidding parts circularly followed by a multiple gives A328599.
Partitions with no part followed by a divisor are A328171.

Programs

  • Mathematica
    Table[Length[Select[Join@@Permutations/@IntegerPartitions[n],And@@Not/@Divisible@@@Partition[#,2,1,1]&]],{n,0,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)={concat([1], sum(k=1, n, b(n, k, (i,j)->i%j<>0)))} \\ Andrew Howroyd, Oct 26 2019

Formula

a(n > 0) = A318726(n) - 1.

Extensions

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

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

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

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

Original entry on oeis.org

1, 0, 0, 0, 0, 2, 0, 4, 2, 4, 12, 8, 22, 14, 36, 44, 62, 114, 130, 206, 264, 414, 602, 822, 1250, 1672, 2520, 3518, 5146, 7408, 10448, 15224, 21496, 31284, 44718, 64170, 92314, 131618, 190084, 271870, 391188, 560978, 804264, 1155976, 1656428, 2381306, 3414846
Offset: 0

Views

Author

Gus Wiseman, Oct 25 2019

Keywords

Comments

A composition of n is a finite sequence of positive integers summing to n.
Circularity means the last part is followed by the first.

Examples

			The a(0) = 1 through a(12) = 22 compositions (empty columns not shown):
  ()  (2,3)  (2,5)  (3,5)  (2,7)  (3,7)      (2,9)  (5,7)
      (3,2)  (3,4)  (5,3)  (4,5)  (4,6)      (3,8)  (7,5)
             (4,3)         (5,4)  (6,4)      (4,7)  (2,3,7)
             (5,2)         (7,2)  (7,3)      (5,6)  (2,7,3)
                                  (2,3,5)    (6,5)  (3,2,7)
                                  (2,5,3)    (7,4)  (3,4,5)
                                  (3,2,5)    (8,3)  (3,5,4)
                                  (3,5,2)    (9,2)  (3,7,2)
                                  (5,2,3)           (4,3,5)
                                  (5,3,2)           (4,5,3)
                                  (2,3,2,3)         (5,3,4)
                                  (3,2,3,2)         (5,4,3)
                                                    (7,2,3)
                                                    (7,3,2)
                                                    (2,3,2,5)
                                                    (2,3,4,3)
                                                    (2,5,2,3)
                                                    (3,2,3,4)
                                                    (3,2,5,2)
                                                    (3,4,3,2)
                                                    (4,3,2,3)
                                                    (5,2,3,2)
		

Crossrefs

The necklace version is A328601.
The case forbidding only divisors (not multiples) is A328598.
The non-circular version is A328508.
Partitions with no part followed by a divisor are A328171.

Programs

  • Mathematica
    Table[Length[Select[Join@@Permutations/@IntegerPartitions[n],And@@Not/@Divisible@@@Partition[#,2,1,1]&&And@@Not/@Divisible@@@Reverse/@Partition[#,2,1,1]&]],{n,0,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)={concat([1], sum(k=1, n, b(n, k, (i,j)->i%j<>0&&j%i<>0)))} \\ Andrew Howroyd, Oct 26 2019

Extensions

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

A328602 Number of necklace compositions of n where no pair of circularly adjacent parts is relatively prime.

Original entry on oeis.org

0, 1, 1, 2, 1, 4, 1, 5, 3, 8, 1, 16, 1, 20, 9, 35, 2, 69, 3, 111, 24, 190, 13, 384, 31, 646, 102, 1212, 113, 2348, 227, 4254, 613, 7993, 976, 15459, 1915, 28825, 4357, 54988, 7868, 105826, 15760, 201115, 33376, 385590, 63974, 744446, 128224, 1428047, 262914, 2754037
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(2) = 1 through a(10) = 8 necklace compositions:
  (2)  (3)  (4)    (5)  (6)      (7)  (8)        (9)      (10)
            (2,2)       (2,4)         (2,6)      (3,6)    (2,8)
                        (3,3)         (4,4)      (3,3,3)  (4,6)
                        (2,2,2)       (2,2,4)             (5,5)
                                      (2,2,2,2)           (2,2,6)
                                                          (2,4,4)
                                                          (2,2,2,4)
                                                          (2,2,2,2,2)
The a(19) = 3 necklace compositions are: (19), (3,6,4,6), (2,2,6,3,6).
		

Crossrefs

The non-necklace, non-circular version is A178470.
The version for indivisibility (rather than co-primality) is A328600.
The circularly coprime (as opposed to anti-coprime) version is A328597.
Partitions with no consecutive parts relatively prime are A328187.

Programs

  • Mathematica
    neckQ[q_]:=Array[OrderedQ[{q,RotateRight[q,#]}]&,Length[q]-1,1,And];
    Table[Length[Select[Join@@Permutations/@IntegerPartitions[n],neckQ[#]&&And@@Not/@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

Extensions

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

A318730 Number of cyclic compositions (necklaces of positive integers) summing to n with adjacent parts (including the last and first part) being indivisible (either way).

Original entry on oeis.org

1, 1, 1, 1, 2, 1, 3, 2, 3, 6, 5, 8, 7, 14, 15, 21, 31, 39, 51, 69, 98, 133, 177, 254, 329, 471, 632, 902, 1230, 1710, 2370, 3270, 4591, 6384, 8898, 12429, 17252, 24230, 33783, 47405, 66254, 92860, 130142, 182469, 256262, 359676, 505231, 710059, 997953, 1404215
Offset: 1

Views

Author

Gus Wiseman, Sep 02 2018

Keywords

Examples

			The a(14) = 14 cyclic compositions with adjacent parts indivisible either way:
  (14)
  (3,11) (4,10) (5,9) (6,8)
  (2,5,7) (2,7,5) (3,4,7) (3,7,4)
  (2,3,2,7) (2,3,4,5) (2,5,2,5) (2,5,4,3) (3,4,3,4)
		

Crossrefs

Programs

  • Mathematica
    neckQ[q_]:=Array[OrderedQ[{q,RotateRight[q,#]}]&,Length[q]-1,1,And];
    Table[Length[Select[Join@@Permutations/@IntegerPartitions[n],Or[Length[#]==1,And[neckQ[#],And@@Not/@Divisible@@@Partition[#,2,1,1],And@@Not/@Divisible@@@Reverse/@Partition[#,2,1,1]]]&]],{n,20}]
  • 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, 1 + sumdiv(n, d, eulerphi(d)*v[n/d])/n)} \\ Andrew Howroyd, Oct 27 2019

Formula

a(n) = A328601(n) + 1. - Andrew Howroyd, Oct 27 2019

Extensions

Terms a(21) and beyond from Andrew Howroyd, Sep 08 2018

A328608 Numbers whose binary indices have no part circularly followed by a divisor or a multiple.

Original entry on oeis.org

6, 12, 18, 20, 22, 24, 28, 30, 40, 48, 56, 66, 68, 70, 72, 76, 78, 80, 82, 84, 86, 88, 92, 94, 96, 104, 108, 110, 112, 114, 116, 118, 120, 124, 126, 132, 144, 148, 156, 160, 172, 176, 180, 188, 192, 196, 204, 208, 212, 220, 224, 236, 240, 244, 252, 258, 264
Offset: 1

Views

Author

Gus Wiseman, Oct 25 2019

Keywords

Comments

A binary index of n is any position of a 1 in its reversed binary expansion. The binary indices of n are row n of A048793.
Circularity means the last part is followed by the first.
Note that this is a somewhat degenerate case, as a part could only be followed by a divisor if it is the last part followed by the first.

Examples

			The sequence of terms together with their binary expansions and binary indices begins:
    6:       110 ~ {2,3}
   12:      1100 ~ {3,4}
   18:     10010 ~ {2,5}
   20:     10100 ~ {3,5}
   22:     10110 ~ {2,3,5}
   24:     11000 ~ {4,5}
   28:     11100 ~ {3,4,5}
   30:     11110 ~ {2,3,4,5}
   40:    101000 ~ {4,6}
   48:    110000 ~ {5,6}
   56:    111000 ~ {4,5,6}
   66:   1000010 ~ {2,7}
   68:   1000100 ~ {3,7}
   70:   1000110 ~ {2,3,7}
   72:   1001000 ~ {4,7}
   76:   1001100 ~ {3,4,7}
   78:   1001110 ~ {2,3,4,7}
   80:   1010000 ~ {5,7}
   82:   1010010 ~ {2,5,7}
   84:   1010100 ~ {3,5,7}
		

Crossrefs

The composition version is A328599.
The necklace composition version is A328601.
Compositions with no consecutive divisors or multiples are A328508.
Numbers whose binary indices are pairwise indivisible are A326704.

Programs

  • Mathematica
    Select[Range[100],!MatchQ[Append[Join@@Position[Reverse[IntegerDigits[#,2]],1],1+IntegerExponent[#,2]],{_,x_,y_,_}/;Divisible[x,y]||Divisible[y,x]]&]

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-9 of 9 results.