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

A326017 Triangle read by rows where T(n,k) is the number of knapsack partitions of n with maximum k.

Original entry on oeis.org

1, 0, 1, 0, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 2, 1, 1, 0, 1, 1, 1, 2, 1, 1, 0, 1, 1, 2, 3, 2, 1, 1, 0, 1, 1, 2, 1, 3, 2, 1, 1, 0, 1, 1, 2, 2, 4, 3, 2, 1, 1, 0, 1, 1, 2, 3, 1, 4, 3, 2, 1, 1, 0, 1, 1, 3, 3, 4, 6, 4, 3, 2, 1, 1, 0, 1, 1, 1, 1, 3, 1, 6, 4
Offset: 0

Views

Author

Gus Wiseman, Jun 03 2019

Keywords

Comments

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

Examples

			Triangle begins:
  1
  0  1
  0  1  1
  0  1  1  1
  0  1  1  1  1
  0  1  1  2  1  1
  0  1  1  1  2  1  1
  0  1  1  2  3  2  1  1
  0  1  1  2  1  3  2  1  1
  0  1  1  2  2  4  3  2  1  1
  0  1  1  2  3  1  4  3  2  1  1
  0  1  1  3  3  4  6  4  3  2  1  1
  0  1  1  1  1  3  1  6  4  3  2  1  1
  0  1  1  3  3  5  4  7  6  4  3  2  1  1
  0  1  1  2  3  5  4  1  7  6  4  3  2  1  1
  0  1  1  2  3  4  6  6 11  7  6  4  3  2  1  1
Row n = 9 counts the following partitions:
  (111111111)  (22221)  (333)   (432)  (54)     (63)    (72)   (81)  (9)
                        (3222)  (441)  (522)    (621)   (711)
                                       (531)    (6111)
                                       (51111)
		

Crossrefs

Programs

  • Mathematica
    ks[n_]:=Select[IntegerPartitions[n],UnsameQ@@Total/@Union[Subsets[#]]&];
    Table[Length[Select[ks[n],Length[#]==k==0||Max@@#==k&]],{n,0,15},{k,0,n}]

A326016 Number of knapsack partitions of n such that no addition of one part up to the maximum 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, 0, 1, 0, 8, 0, 8, 4, 3, 0, 11, 5, 3, 2, 5, 0, 29, 2, 9, 8, 20, 2
Offset: 1

Views

Author

Gus Wiseman, Jun 03 2019

Keywords

Comments

An integer partition is knapsack if every distinct submultiset has a different sum.
The Heinz numbers of these partitions are given by A326018.

Examples

			The initial terms count the following partitions:
  15: (5,4,3,3)
  21: (7,6,5,3)
  21: (7,5,3,3,3)
  24: (8,7,6,3)
  25: (7,5,5,4,4)
  27: (9,8,7,3)
  27: (9,7,6,5)
  27: (8,7,3,3,3,3)
  31: (10,8,6,6,1)
  33: (11,9,7,3,3)
  33: (11,8,5,5,4)
  33: (11,7,6,6,3)
  33: (11,7,3,3,3,3,3)
  33: (11,5,5,4,4,4)
  33: (10,9,8,3,3)
  33: (10,8,6,6,3)
  33: (10,8,3,3,3,3,3)
		

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,Range[Max@@#]}],ksQ]=={}&];
    Table[Length[maxks[n]],{n,30}]

A326015 Number of strict knapsack partitions of n such that no superset with the same maximum is knapsack.

Original entry on oeis.org

1, 0, 1, 1, 1, 0, 1, 1, 3, 2, 4, 4, 5, 3, 3, 4, 6, 2, 7, 6, 13, 9, 19, 16, 27, 21, 40, 33, 47, 37, 54, 48, 66, 51, 65, 65, 77, 64, 80, 71, 96, 60, 106, 95, 112, 93, 152, 114, 191, 131, 242, 192, 303, 210, 366, 300, 482, 352, 581, 450, 713, 539, 882, 689, 995
Offset: 1

Views

Author

Gus Wiseman, Jun 03 2019

Keywords

Comments

An integer partition is knapsack if every distinct submultiset has a different sum.
These are the subsets counted by A325867, ordered by sum rather than maximum.

Examples

			The a(1) = 1 through a(17) = 6 strict knapsack partitions (empty columns not shown):
  {1}  {2,1}  {3,1}  {3,2}  {4,2,1}  {5,2,1}  {4,3,2}  {6,3,1}  {5,4,2}
                                              {5,3,1}  {7,2,1}  {6,3,2}
                                              {6,2,1}           {6,4,1}
                                                                {7,3,1}
.
  {5,4,3}  {6,4,3}  {6,5,3}  {6,5,4}    {7,5,4}    {7,6,4}
  {7,3,2}  {6,5,2}  {8,5,1}  {7,6,2}    {9,4,3}    {9,5,3}
  {7,4,1}  {7,4,2}  {9,3,2}  {8,4,2,1}  {9,6,1}    {9,6,2}
  {8,3,1}  {7,5,1}                      {9,4,2,1}  {8,4,3,2}
           {9,3,1}                                 {9,5,2,1}
                                                   {10,4,2,1}
		

Crossrefs

Programs

  • Mathematica
    ksQ[y_]:=UnsameQ@@Total/@Union[Subsets[y]]
    maxsks[n_]:=Select[Select[IntegerPartitions[n],UnsameQ@@#&&ksQ[#]&],Select[Table[Append[#,i],{i,Complement[Range[Max@@#],#]}],ksQ]=={}&];
    Table[Length[maxsks[n]],{n,30}]

A326034 Number of knapsack partitions of n with largest part 3.

Original entry on oeis.org

0, 0, 0, 1, 1, 2, 1, 2, 2, 2, 2, 3, 1, 3, 2, 2, 2, 3, 1, 3, 2, 2, 2, 3, 1, 3, 2, 2, 2, 3, 1, 3, 2, 2, 2, 3, 1, 3, 2, 2, 2, 3, 1, 3, 2, 2, 2, 3, 1, 3, 2, 2, 2, 3, 1, 3, 2, 2, 2, 3, 1, 3, 2, 2, 2, 3, 1, 3, 2, 2, 2, 3, 1, 3, 2, 2, 2, 3, 1, 3, 2, 2, 2, 3, 1, 3, 2
Offset: 0

Views

Author

Gus Wiseman, Jun 04 2019

Keywords

Comments

An integer partition is knapsack if every distinct submultiset has a different sum.
Appears to repeat the terms (2,2,2,3,1,3) ad infinitum.
I computed terms a(n) for n = 0..5000 and (2,2,2,3,1,3) is repeated continuously starting at a(8). - Fausto A. C. Cariboni, May 14 2021

Examples

			The initial values count the following partitions:
   3: (3)
   4: (3,1)
   5: (3,2)
   5: (3,1,1)
   6: (3,3)
   7: (3,3,1)
   7: (3,2,2)
   8: (3,3,2)
   8: (3,3,1,1)
   9: (3,3,3)
   9: (3,2,2,2)
  10: (3,3,3,1)
  10: (3,3,2,2)
  11: (3,3,3,2)
  11: (3,3,3,1,1)
  11: (3,2,2,2,2)
  12: (3,3,3,3)
  13: (3,3,3,3,1)
  13: (3,3,3,2,2)
  13: (3,2,2,2,2,2)
  14: (3,3,3,3,2)
  14: (3,3,3,3,1,1)
  15: (3,3,3,3,3)
  15: (3,2,2,2,2,2,2)
		

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]}]])];
    kst[n_]:=Select[IntegerPartitions[n,All,{1,2,3}],Length[sums[Sort[#]]]==Times@@(Length/@Split[#]+1)-1&];
    Table[Length[Select[kst[n],Max@@#==3&]],{n,0,30}]

A326019 Heinz numbers of non-knapsack partitions such that every non-singleton submultiset has a different sum.

Original entry on oeis.org

12, 30, 40, 63, 70, 112, 154, 165, 198, 220, 273, 286, 325, 351, 352, 364, 442, 561, 595, 646, 714, 741, 748, 765, 832, 850, 874, 918, 931, 952, 988, 1045, 1173, 1254, 1334, 1425, 1495, 1539, 1564, 1653, 1672, 1771, 1794, 1798, 1900, 2139, 2176, 2204, 2254
Offset: 1

Views

Author

Gus Wiseman, Jun 03 2019

Keywords

Comments

A subsequence of A299729.
The Heinz number of an integer partition (y_1,...,y_k) is prime(y_1)*...*prime(y_k).
An integer partition is knapsack if every distinct submultiset has a different sum.

Examples

			The sequence of terms together with their prime indices begins:
   12: {1,1,2}
   30: {1,2,3}
   40: {1,1,1,3}
   63: {2,2,4}
   70: {1,3,4}
  112: {1,1,1,1,4}
  154: {1,4,5}
  165: {2,3,5}
  198: {1,2,2,5}
  220: {1,1,3,5}
  273: {2,4,6}
  286: {1,5,6}
  325: {3,3,6}
  351: {2,2,2,6}
  352: {1,1,1,1,1,5}
  364: {1,1,4,6}
  442: {1,6,7}
  561: {2,5,7}
  595: {3,4,7}
  646: {1,7,8}
		

Crossrefs

Programs

  • Mathematica
    hwt[n_]:=Total[Cases[FactorInteger[n],{p_,k_}:>PrimePi[p]*k]];
    Select[Range[1000],!UnsameQ@@hwt/@Divisors[#]&&UnsameQ@@hwt/@Select[Divisors[#],!PrimeQ[#]&]&]

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}]
Showing 1-6 of 6 results.