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

A318728 Number of cyclic compositions (necklaces of positive integers) summing to n that have only one part or whose adjacent parts (including the last with first) are coprime.

Original entry on oeis.org

1, 2, 3, 4, 6, 9, 13, 22, 34, 58, 95, 168, 280, 492, 853, 1508, 2648, 4715, 8350, 14924, 26643, 47794, 85779, 154475, 278323, 502716, 908913, 1646206, 2984547, 5418653, 9847190, 17916001, 32625618, 59470540, 108493150, 198094483, 361965239, 661891580, 1211162271
Offset: 1

Views

Author

Gus Wiseman, Sep 02 2018

Keywords

Examples

			The a(7) = 13 cyclic compositions with adjacent parts coprime:
  7,
  16, 25, 34,
  115,
  1114, 1213, 1132, 1123,
  11113, 11212,
  111112,
  1111111.
		

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,neckQ[#]&&And@@CoprimeQ@@@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)->gcd(i,j)==1))); vector(n, n, (n > 1) + sumdiv(n, d, eulerphi(d)*v[n/d])/n)} \\ Andrew Howroyd, Oct 27 2019

Formula

a(n) = A328597(n) + 1 for n > 1. - Andrew Howroyd, Oct 27 2019

Extensions

Terms a(21) and beyond from Andrew Howroyd, Sep 08 2018
Name corrected by Gus Wiseman, Nov 04 2019

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

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

A328609 Number of compositions of n whose circularly adjacent parts are relatively prime.

Original entry on oeis.org

1, 1, 1, 3, 6, 12, 23, 42, 81, 150, 284, 534, 1004, 1882, 3532, 6630, 12459, 23406, 43951, 82537, 154998, 291087, 546673, 1026686, 1928117, 3621016, 6800299, 12771085, 23984328, 45042958, 84591338, 158863806, 298348612, 560303341, 1052258401, 1976157509
Offset: 0

Views

Author

Gus Wiseman, Oct 26 2019

Keywords

Comments

Circularity means the last part is followed by the first.

Examples

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

Crossrefs

The necklace version is A328597 or A318728 (with singletons).
The aperiodic version is A328670.
The Lyndon word version is A318745.
The version with singletons is A318748.
The non-circular version is A167606.
Relatively prime compositions are A000740.
Compositions with no part circularly followed by a divisor are A328598.

Programs

  • Mathematica
    Table[Length[Select[Join@@Permutations/@IntegerPartitions[n],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)={concat([1], sum(k=1, n, b(n, k, (i, j)->gcd(i, j)==1)))} \\ Andrew Howroyd, Nov 01 2019

Formula

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

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

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