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-2 of 2 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

A325592 Triangle read by rows where T(n,k) is the number of length-k knapsack partitions of n.

Original entry on oeis.org

1, 0, 1, 0, 1, 1, 0, 1, 1, 1, 0, 1, 2, 0, 1, 0, 1, 2, 2, 0, 1, 0, 1, 3, 2, 0, 0, 1, 0, 1, 3, 4, 2, 0, 0, 1, 0, 1, 4, 3, 3, 0, 0, 0, 1, 0, 1, 4, 7, 2, 2, 0, 0, 0, 1, 0, 1, 5, 6, 4, 2, 0, 0, 0, 0, 1, 0, 1, 5, 10, 6, 4, 2, 0, 0, 0, 0, 1, 0, 1, 6, 9, 5, 1, 2, 0, 0, 0, 0, 0, 1
Offset: 0

Views

Author

Gus Wiseman, May 15 2019

Keywords

Comments

A knapsack partition of n is an integer partition of n whose distinct submultisets all have different sums.

Examples

			Triangle begins:
  1
  0  1
  0  1  1
  0  1  1  1
  0  1  2  0  1
  0  1  2  2  0  1
  0  1  3  2  0  0  1
  0  1  3  4  2  0  0  1
  0  1  4  3  3  0  0  0  1
  0  1  4  7  2  2  0  0  0  1
  0  1  5  6  4  2  0  0  0  0  1
  0  1  5 10  6  4  2  0  0  0  0  1
  0  1  6  9  5  1  2  0  0  0  0  0  1
  0  1  6 14 10  5  2  2  0  0  0  0  0  1
  0  1  7 13 11  3  3  2  0  0  0  0  0  0  1
  0  1  7 19 16  7  3  2  2  0  0  0  0  0  0  1
Row n = 12 counts the following partitions (A = 10, B = 11, C = 12):
   (C)  (66)   (444)   (3333)  (81111)  (222222)  (111111111111)
        (75)   (543)   (5511)           (711111)
        (84)   (552)   (7221)
        (93)   (732)   (7311)
        (A2)   (741)   (9111)
        (B1)   (822)
               (831)
               (921)
               (A11)
		

Crossrefs

Row sums are A000041.
Column k = 2 is A004526.
Column k = 3 is A325690.

Programs

  • Mathematica
    Table[Length[Select[IntegerPartitions[n,{k}],UnsameQ@@Total/@Union[Subsets[#]]&]],{n,0,15},{k,0,n}]
Showing 1-2 of 2 results.