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.

A178470 Number of compositions (ordered partitions) of n where no pair of adjacent part sizes is relatively prime.

Original entry on oeis.org

1, 1, 1, 1, 2, 1, 5, 1, 8, 4, 17, 3, 38, 5, 67, 25, 132, 27, 290, 54, 547, 163, 1086, 255, 2277, 530, 4416, 1267, 8850, 2314, 18151, 4737, 35799, 10499, 71776, 20501, 145471, 41934, 289695, 89030, 581117, 178424, 1171545, 365619, 2342563, 761051, 4699711
Offset: 0

Views

Author

Keywords

Comments

A178472(n) is a lower bound for a(n). This bound is exact for n = 2..10 and 12, but falls behind thereafter.
a(0) = 1 vacuously for the empty composition. One could take a(1) = 0, on the theory that each composition is followed by infinitely many 0's, and thus the 1 is not relatively prime to its neighbor; but this definition seems simpler.

Examples

			The three compositions for 11 are <11>, <2,6,3> and <3,6,2>.
From _Gus Wiseman_, Nov 19 2019: (Start)
The a(1) = 1 through a(11) = 3 compositions (A = 10, B = 11):
  1  2  3  4   5  6    7  8     9    A      B
           22     24      26    36   28     263
                  33      44    63   46     362
                  42      62    333  55
                  222     224        64
                          242        82
                          422        226
                          2222       244
                                     262
                                     424
                                     442
                                     622
                                     2224
                                     2242
                                     2422
                                     4222
                                     22222
(End)
		

Crossrefs

The case of partitions is A328187, with Heinz numbers A328336.
Partitions with all pairs of consecutive parts relatively prime are A328172.
Compositions without consecutive divisible parts are A328460 (one way) or A328508 (both ways).

Programs

  • Maple
    b:= proc(n, h) option remember; `if`(n=0, 1,
          add(`if`(h=1 or igcd(j, h)>1, b(n-j, j), 0), j=2..n))
        end:
    a:= n-> `if`(n=1, 1, b(n, 1)):
    seq(a(n), n=0..60);  # Alois P. Heinz, Oct 23 2011
  • Mathematica
    b[n_, h_] := b[n, h] = If[n == 0, 1, Sum [If[h == 1 || GCD[j, h] > 1, b[n - j, j], 0], {j, 2, n}]]; a[n_] := If[n == 1, 1, b[n, 1]]; Table[a[n], {n, 0, 60}] (* Jean-François Alcover, Oct 29 2015, after Alois P. Heinz *)
    Table[Length[Select[Join@@Permutations/@IntegerPartitions[n],!MatchQ[#,{_,x_,y_,_}/;GCD[x,y]==1]&]],{n,0,20}] (* Gus Wiseman, Nov 19 2019 *)
  • PARI
    am(n)=local(r);r=matrix(n,n,i,j,i==j);for(i=2,n,for(j=1,i-1,for(k=1,j,if(gcd(i-j,k)>1,r[i,i-j]+=r[j,k]))));r
    al(n)=local(m);m=am(n);vector(n,i,sum(j=1,i,m[i,j]))

A328460 Number of compositions of n with no part divisible by the next.

Original entry on oeis.org

1, 1, 1, 2, 2, 4, 5, 8, 11, 16, 26, 35, 53, 76, 115, 168, 244, 363, 528, 782, 1144, 1685, 2474, 3633, 5347, 7844, 11539, 16946, 24919, 36605, 53782, 79053, 116142, 170700, 250800, 368585, 541610, 795884, 1169572, 1718593, 2525522, 3711134, 5453542, 8013798, 11776138
Offset: 0

Views

Author

Gus Wiseman, Oct 17 2019

Keywords

Examples

			The a(1) = 1 through a(9) = 16 compositions:
  (1)  (2)  (3)   (4)   (5)   (6)    (7)    (8)     (9)
            (21)  (31)  (23)  (42)   (25)   (35)    (27)
                        (32)  (51)   (34)   (53)    (45)
                        (41)  (231)  (43)   (62)    (54)
                              (321)  (52)   (71)    (63)
                                     (61)   (251)   (72)
                                     (232)  (323)   (81)
                                     (421)  (341)   (234)
                                            (431)   (252)
                                            (521)   (342)
                                            (2321)  (351)
                                                    (423)
                                                    (432)
                                                    (531)
                                                    (621)
                                                    (3231)
		

Crossrefs

The case of partitions is A328171.
If we also require no part to be divisible by the prior, we get A328508.
Compositions with each part relatively prime to the next are A167606.
Compositions with no part relatively prime to the next are A178470.

Programs

  • Mathematica
    Table[Length[Select[Join@@Permutations/@IntegerPartitions[n],!MatchQ[#,{_,x_,y_,_}/;Divisible[y,x]]&]],{n,0,10}]
  • PARI
    seq(n)={my(r=matid(n)); for(k=1, n, for(i=1, k-1, r[i,k]=sum(j=1, k-i, if(j%i, r[j, k-i])))); concat([1], vecsum(Col(r)))} \\ Andrew Howroyd, Oct 19 2019

Extensions

Terms a(26) and beyond from Andrew Howroyd, Oct 19 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

A328593 Numbers whose binary indices have no consecutive divisible parts.

Original entry on oeis.org

0, 1, 2, 4, 6, 8, 12, 14, 16, 18, 20, 22, 24, 28, 30, 32, 40, 44, 46, 48, 50, 52, 54, 56, 60, 62, 64, 66, 68, 70, 72, 76, 78, 80, 82, 84, 86, 88, 92, 94, 96, 104, 108, 110, 112, 114, 116, 118, 120, 124, 126, 128, 132, 134, 144, 146, 148, 150, 152, 156, 158, 160
Offset: 1

Views

Author

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

Examples

			The sequence of terms together with their binary expansions and binary indices begins:
   0:      0 ~ {}
   1:      1 ~ {1}
   2:     10 ~ {2}
   4:    100 ~ {3}
   6:    110 ~ {2,3}
   8:   1000 ~ {4}
  12:   1100 ~ {3,4}
  14:   1110 ~ {2,3,4}
  16:  10000 ~ {5}
  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}
  32: 100000 ~ {6}
  40: 101000 ~ {4,6}
  44: 101100 ~ {3,4,6}
  46: 101110 ~ {2,3,4,6}
  48: 110000 ~ {5,6}
  50: 110010 ~ {2,5,6}
		

Crossrefs

The version for prime indices is A328603.
Numbers with no successive binary indices are A003714.
Partitions with no consecutive divisible parts are A328171.
Compositions without consecutive divisible parts are A328460.

Programs

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

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

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

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]]&]

A328675 Number of integer partitions of n with no two distinct consecutive parts divisible.

Original entry on oeis.org

1, 1, 2, 2, 3, 3, 4, 5, 6, 8, 9, 13, 13, 22, 23, 30, 36, 50, 54, 77, 85, 113, 135, 170, 194, 256, 303, 369, 440, 545, 640, 792, 931, 1132, 1347, 1616, 1909, 2295, 2712, 3225, 3799, 4519, 5310, 6278, 7365, 8675, 10170, 11928, 13940, 16314, 19046, 22223, 25856
Offset: 0

Views

Author

Gus Wiseman, Oct 29 2019

Keywords

Examples

			The a(1) = 1 through a(10) = 9 partitions (A = 10).
  1  2   3    4     5      6       7        8         9          A
     11  111  22    32     33      43       44        54         55
              1111  11111  222     52       53        72         64
                           111111  322      332       333        73
                                   1111111  2222      432        433
                                            11111111  522        532
                                                      3222       3322
                                                      111111111  22222
                                                                 1111111111
		

Crossrefs

The Heinz numbers of these partitions are given by A328674.
The case involving all consecutive parts (not just distinct) is A328171.
The version for relative primality instead of divisibility is A328187.
Partitions with all consecutive parts divisible are A003238.
Compositions without consecutive divisibilities are A328460.

Programs

  • Mathematica
    Table[Length[Select[IntegerPartitions[n],!MatchQ[Union[#],{_,x_,y_,_}/;Divisible[y,x]]&]],{n,0,30}]
Showing 1-9 of 9 results.