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.

A326033 Number of knapsack partitions of n such that no addition of one part equal to an existing part is knapsack.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 2, 0, 0, 1, 1, 0, 3, 0, 0, 1, 1, 0, 8, 0, 8, 4, 3, 0, 11, 5, 3, 4, 5, 0, 30, 2, 9, 9, 20, 3, 37, 6, 18, 16, 37, 20, 71, 12, 37, 40
Offset: 1

Views

Author

Gus Wiseman, Jun 03 2019

Keywords

Comments

An integer partition is knapsack if every distinct submultiset has a different sum.

Examples

			The partition (10,8,6,6) is counted under a(30) because (10,10,8,6,6), (10,8,8,6,6), and (10,8,6,6,6) are not knapsack.
		

Crossrefs

Programs

  • Mathematica
    sums[ptn_]:=sums[ptn]=If[Length[ptn]==1,ptn,Union@@(Join[sums[#],sums[#]+Total[ptn]-Total[#]]&/@Union[Table[Delete[ptn,i],{i,Length[ptn]}]])];
    ksQ[y_]:=Length[sums[Sort[y]]]==Times@@(Length/@Split[Sort[y]]+1)-1;
    maxks[n_]:=Select[IntegerPartitions[n],ksQ[#]&&Select[Table[Sort[Append[#,i]],{i,Union[#]}],ksQ]=={}&];
    Table[Length[maxks[n]],{n,30}]