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.

A325676 Number of compositions of n such that every distinct consecutive subsequence has a different sum.

Original entry on oeis.org

1, 1, 2, 4, 5, 10, 12, 24, 26, 47, 50, 96, 104, 172, 188, 322, 335, 552, 590, 938, 1002, 1612, 1648, 2586, 2862, 4131, 4418, 6718, 7122, 10332, 11166, 15930, 17446, 24834, 26166, 37146, 41087, 55732, 59592, 84068, 89740, 122106, 133070, 177876, 194024, 262840, 278626
Offset: 0

Views

Author

Gus Wiseman, May 13 2019

Keywords

Comments

A composition of n is a finite sequence of positive integers summing to n.
Compare to the definition of knapsack partitions (A108917).

Examples

			The distinct consecutive subsequences of (1,4,4,3) together with their sums are:
   1: {1}
   3: {3}
   4: {4}
   5: {1,4}
   7: {4,3}
   8: {4,4}
   9: {1,4,4}
  11: {4,4,3}
  12: {1,4,4,3}
Because the sums are all different, (1,4,4,3) is counted under a(12).
The a(1) = 1 through a(6) = 12 compositions:
  (1)  (2)   (3)    (4)     (5)      (6)
       (11)  (12)   (13)    (14)     (15)
             (21)   (22)    (23)     (24)
             (111)  (31)    (32)     (33)
                    (1111)  (41)     (42)
                            (113)    (51)
                            (122)    (114)
                            (221)    (132)
                            (311)    (222)
                            (11111)  (231)
                                     (411)
                                     (111111)
		

Crossrefs

Programs

  • Mathematica
    Table[Length[Select[Join@@Permutations/@IntegerPartitions[n],UnsameQ@@Total/@Union[ReplaceList[#,{_,s__,_}:>{s}]]&]],{n,0,15}]

Extensions

a(21)-a(22) from Jinyuan Wang, Jun 20 2020
a(23)-a(25) from Robert Price, Jun 19 2021
a(26)-a(46) from Fausto A. C. Cariboni, Feb 10 2022

A325687 Triangle read by rows where T(n,k) is the number of length-k compositions of n such that every distinct consecutive subsequence has a different sum.

Original entry on oeis.org

1, 1, 1, 1, 2, 1, 1, 3, 0, 1, 1, 4, 4, 0, 1, 1, 5, 5, 0, 0, 1, 1, 6, 12, 4, 0, 0, 1, 1, 7, 12, 5, 0, 0, 0, 1, 1, 8, 25, 8, 4, 0, 0, 0, 1, 1, 9, 24, 12, 3, 0, 0, 0, 0, 1, 1, 10, 40, 32, 8, 4, 0, 0, 0, 0, 1, 1, 11, 41, 41, 6, 3, 0, 0, 0, 0, 0, 1
Offset: 1

Views

Author

Gus Wiseman, May 13 2019

Keywords

Comments

A composition of n is a finite sequence of positive integers summing to n.

Examples

			The distinct consecutive subsequences of (1,1,3,3) are (1), (1,1), (3), (1,3), (1,1,3), (3,3), (1,3,3), (1,1,3,3), all of which have different sums, so (1,1,3,3) is counted under a(8).
Triangle begins:
  1
  1  1
  1  2  1
  1  3  0  1
  1  4  4  0  1
  1  5  5  0  0  1
  1  6 12  4  0  0  1
  1  7 12  5  0  0  0  1
  1  8 25  8  4  0  0  0  1
  1  9 24 12  3  0  0  0  0  1
  1 10 40 32  8  4  0  0  0  0  1
  1 11 41 41  6  3  0  0  0  0  0  1
  1 12 60 76 14  4  4  0  0  0  0  0  1
  1 13 60 88 16  6  3  0  0  0  0  0  0  1
Row n = 8 counts the following compositions:
  (8)  (17)  (116)  (1115)  (11111111)
       (26)  (125)  (1133)
       (35)  (143)  (2222)
       (44)  (152)  (3311)
       (53)  (215)  (5111)
       (62)  (233)
       (71)  (251)
             (332)
             (341)
             (512)
             (521)
             (611)
		

Crossrefs

Row sums are A325676.
Column k = 2 is A000027.
Column k = 3 is A325688.

Programs

  • Mathematica
    Table[Length[Select[Join@@Permutations/@IntegerPartitions[n,{k}],UnsameQ@@Total/@Union[ReplaceList[#,{_,s__,_}:>{s}]]&]],{n,15},{k,n}]

A325680 Number of compositions of n such that every distinct circular subsequence has a different sum.

Original entry on oeis.org

1, 1, 2, 4, 5, 6, 8, 14, 16, 29, 24, 42, 46, 78, 66, 146, 133, 242, 208, 386, 352, 620, 494, 948, 842, 1447
Offset: 0

Views

Author

Gus Wiseman, May 13 2019

Keywords

Comments

A composition of n is a finite sequence of positive integers summing to n.
A circular subsequence is a sequence of consecutive terms where the first and last parts are also considered consecutive.

Examples

			The a(1) = 1 through a(8) = 16 compositions:
  (1)  (2)   (3)    (4)     (5)      (6)       (7)        (8)
       (11)  (12)   (13)    (14)     (15)      (16)       (17)
             (21)   (22)    (23)     (24)      (25)       (26)
             (111)  (31)    (32)     (33)      (34)       (35)
                    (1111)  (41)     (42)      (43)       (44)
                            (11111)  (51)      (52)       (53)
                                     (222)     (61)       (62)
                                     (111111)  (124)      (71)
                                               (142)      (125)
                                               (214)      (152)
                                               (241)      (215)
                                               (412)      (251)
                                               (421)      (512)
                                               (1111111)  (521)
                                                          (2222)
                                                          (11111111)
		

Crossrefs

Programs

  • Mathematica
    subalt[q_]:=Union[ReplaceList[q,{_,s__,_}:>{s}],DeleteCases[ReplaceList[q,{t___,,u___}:>{u,t}],{}]];
    Table[Length[Select[Join@@Permutations/@IntegerPartitions[n],UnsameQ@@Total/@subalt[#]&]],{n,0,15}]

Extensions

a(18)-a(25) from Robert Price, Jun 19 2021

A325691 Number of length-3 integer partitions of n whose largest part is not greater than the sum of the other two.

Original entry on oeis.org

0, 0, 0, 1, 1, 1, 2, 2, 3, 3, 4, 4, 6, 5, 7, 7, 9, 8, 11, 10, 13, 12, 15, 14, 18, 16, 20, 19, 23, 21, 26, 24, 29, 27, 32, 30, 36, 33, 39, 37, 43, 40, 47, 44, 51, 48, 55, 52, 60, 56, 64, 61, 69, 65, 74, 70, 79, 75, 84, 80, 90, 85, 95, 91, 101, 96, 107, 102, 113
Offset: 0

Views

Author

Gus Wiseman, May 15 2019

Keywords

Comments

Also the number of possible triples of edge-lengths of a triangle with perimeter n, where degenerate (self-intersecting) triangles are allowed.
The number of triples (a,b,c) for 1 <= a <= b <= c <= a+b and a+b+c = n. - Yuchun Ji, Oct 15 2020

Examples

			The a(3) = 1 through a(12) = 6 partitions:
  (111)  (211)  (221)  (222)  (322)  (332)  (333)  (433)  (443)  (444)
                       (321)  (331)  (422)  (432)  (442)  (533)  (543)
                                     (431)  (441)  (532)  (542)  (552)
                                                   (541)  (551)  (633)
                                                                 (642)
                                                                 (651)
		

Crossrefs

Cf. A001399, A005044 (nondegenerate triangles), A008642, A069905, A124278.

Programs

  • Mathematica
    Table[Length[Select[IntegerPartitions[n,{3}],#[[1]]<=#[[2]]+#[[3]]&]],{n,0,30}]

Formula

Conjectures from Colin Barker, May 16 2019: (Start)
G.f.: x^3*(1 + x - x^4) / ((1 - x)^3*(1 + x)^2*(1 + x^2)*(1 + x + x^2)).
a(n) = a(n-2) + a(n-3) + a(n-4) - a(n-5) - a(n-6) - a(n-7) + a(n-9) for n>8. (End)
a(n) = A005044(n+3) - A000035(n+3). i.e., remove the only one triple (a=0,b,b) if n is even from the A005044 which is the number of triples (a,b,c) for 0 <= a <= b <= c <= a+b and a+b+c = n. - Yuchun Ji, Oct 15 2020
The above conjectured formulas are true. - Stefano Spezia, May 19 2023

A325686 Number of strict length-3 compositions x + y + z = n satisfying x + y != z and x != y + z.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 2, 6, 8, 18, 16, 30, 34, 48, 48, 72, 72, 96, 98, 126, 128, 162, 160, 198, 202, 240, 240, 288, 288, 336, 338, 390, 392, 450, 448, 510, 514, 576, 576, 648, 648, 720, 722, 798, 800, 882, 880, 966, 970, 1056, 1056, 1152, 1152, 1248, 1250, 1350, 1352
Offset: 0

Views

Author

Gus Wiseman, May 13 2019

Keywords

Comments

A strict composition of n is a finite sequence of distinct positive integers summing to n.
From Kevin O'Bryant, Jun 02 2025: (Start)
Also the number of Sidon sets in {0,1,...,n} with 4 elements that contain both 0 and n.
Also, the number of 3-tuples of positive integers with the 6 numbers x, y, z, x+y, y+z, x+y+z=n all distinct. (End)

Examples

			The a(6) = 2 through a(10) = 16 compositions:
  (132)  (124)  (125)  (126)  (127)
  (231)  (142)  (143)  (135)  (136)
         (214)  (152)  (153)  (154)
         (241)  (215)  (162)  (163)
         (412)  (251)  (216)  (172)
         (421)  (341)  (234)  (217)
                (512)  (243)  (253)
                (521)  (261)  (271)
                       (315)  (316)
                       (324)  (352)
                       (342)  (361)
                       (351)  (451)
                       (423)  (613)
                       (432)  (631)
                       (513)  (712)
                       (531)  (721)
                       (612)
                       (621)
		

Crossrefs

Programs

  • Mathematica
    Table[Length[Cases[Join@@Permutations/@IntegerPartitions[n,{3}],{x_,y_,z_}/;x!=y!=z&&x+y!=z &&x!=y+z]],{n,0,30}]

Formula

Conjectures from Colin Barker, May 14 2019: (Start)
G.f.: 2*x^6*(1 + 3*x + 3*x^2 + 5*x^3) / ((1 - x)^3*(1 + x)^2*(1 + x^2)*(1 + x + x^2)).
a(n) = a(n-2) + a(n-3) + a(n-4) - a(n-5) - a(n-6) - a(n-7) + a(n-9) for n>9. (End)
Above conjecture confirmed for n <= 5000. - Fausto A. C. Cariboni, Feb 17 2022

A325689 Number of length-3 compositions of n such that no part is the sum of the other two.

Original entry on oeis.org

0, 0, 0, 1, 0, 6, 4, 15, 12, 28, 24, 45, 40, 66, 60, 91, 84, 120, 112, 153, 144, 190, 180, 231, 220, 276, 264, 325, 312, 378, 364, 435, 420, 496, 480, 561, 544, 630, 612, 703, 684, 780, 760, 861, 840, 946, 924, 1035, 1012, 1128, 1104, 1225, 1200, 1326, 1300, 1431
Offset: 0

Views

Author

Gus Wiseman, May 15 2019

Keywords

Comments

A composition of n is a finite sequence of positive integers summing to n.
Confirmed recurrence relation from Colin Barker for n <= 5000. - Fausto A. C. Cariboni, Feb 15 2022

Examples

			The a(3) = 1 through a(8) = 12 compositions (empty columns not shown):
  (111)  (113)  (114)  (115)  (116)
         (122)  (141)  (124)  (125)
         (131)  (222)  (133)  (152)
         (212)  (411)  (142)  (161)
         (221)         (151)  (215)
         (311)         (214)  (233)
                       (223)  (251)
                       (232)  (323)
                       (241)  (332)
                       (313)  (512)
                       (322)  (521)
                       (331)  (611)
                       (412)
                       (421)
                       (511)
		

Crossrefs

Programs

  • Mathematica
    Table[Length[Select[Join@@Permutations/@IntegerPartitions[n,{3}],And@@Table[#[[i]]!=Total[Delete[#,i]],{i,3}]&]],{n,0,30}]

Formula

Conjectures from Colin Barker, May 16 2019: (Start)
G.f.: x^3*(1 - x + 4*x^2) / ((1 - x)^3*(1 + x)^2) for n>5.
a(n) = -(5 + 3*(-1)^n - 2*n) * (n-2) / 4 for n>0.
a(n) = a(n-1) + 2*a(n-2) - 2*a(n-3) - a(n-4) + a(n-5).
(End)

A325696 Number of length-3 strict compositions of n such that no part is the sum of the other two.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 6, 6, 18, 12, 30, 30, 48, 42, 72, 66, 96, 90, 126, 120, 162, 150, 198, 192, 240, 228, 288, 276, 336, 324, 390, 378, 450, 432, 510, 498, 576, 558, 648, 630, 720, 702, 798, 780, 882, 858, 966, 948, 1056, 1032, 1152, 1128, 1248, 1224, 1350
Offset: 0

Views

Author

Gus Wiseman, May 15 2019

Keywords

Comments

A composition of n is a finite sequence of positive integers summing to n. It is strict if all parts are distinct.

Examples

			The a(6) = 6 through a(10) = 12 compositions:
  (124)  (125)  (126)  (127)
  (142)  (152)  (135)  (136)
  (214)  (215)  (153)  (163)
  (241)  (251)  (162)  (172)
  (412)  (512)  (216)  (217)
  (421)  (521)  (234)  (271)
                (243)  (316)
                (261)  (361)
                (315)  (613)
                (324)  (631)
                (342)  (712)
                (351)  (721)
                (423)
                (432)
                (513)
                (531)
                (612)
                (621)
		

Crossrefs

Cf. A325686, A325688, A325689 (non-strict case), A325695.

Programs

  • Mathematica
    Table[Length[Cases[Join@@Permutations/@IntegerPartitions[n,{3}],{x_,y_,z_}/;x!=y!=z&&x+y!=z&&x!=y+z&&y!=x+z]],{n,0,30}]

Formula

Conjectures from Colin Barker, May 16 2019: (Start)
G.f.: 6*x^7*(1 + x + 2*x^2) / ((1 - x)^3*(1 + x)^2*(1 + x^2)*(1 + x + x^2)).
a(n) = a(n-2) + a(n-3) + a(n-4) - a(n-5) - a(n-6) - a(n-7) + a(n-9) for n>9.
(End)
a(n) = 6 * A325695(n). - Alois P. Heinz, Jun 18 2020
Showing 1-7 of 7 results.