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.

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

A325867 Number of maximal subsets of {1..n} containing n such that every subset has a different sum.

Original entry on oeis.org

1, 1, 2, 2, 4, 8, 10, 12, 17, 34, 45, 77, 99, 136, 166, 200, 238, 328, 402, 660, 674, 1166, 1331, 1966, 2335, 3286, 3527, 4762, 5383, 6900, 7543, 9087, 10149, 12239, 13569, 16452, 17867, 22869, 23977, 33881, 33820, 43423, 48090, 68683, 67347, 95176, 97917, 131666, 136205
Offset: 1

Views

Author

Gus Wiseman, Jun 01 2019

Keywords

Comments

These are maximal strict knapsack partitions (A275972, A326015) organized by maximum rather than sum.

Examples

			The a(1) = 1 through a(8) = 12 subsets:
  {1}  {1,2}  {1,3}  {1,2,4}  {1,2,5}  {1,2,6}  {1,2,7}    {1,3,8}
              {2,3}  {2,3,4}  {1,3,5}  {1,3,6}  {1,3,7}    {1,5,8}
                              {2,4,5}  {1,4,6}  {1,4,7}    {5,7,8}
                              {3,4,5}  {2,3,6}  {1,5,7}    {1,2,4,8}
                                       {2,5,6}  {2,3,7}    {1,4,6,8}
                                       {3,4,6}  {2,4,7}    {2,3,4,8}
                                       {3,5,6}  {2,6,7}    {2,4,5,8}
                                       {4,5,6}  {4,5,7}    {2,4,7,8}
                                                {4,6,7}    {3,4,6,8}
                                                {3,5,6,7}  {3,6,7,8}
                                                           {4,5,6,8}
                                                           {4,6,7,8}
		

Crossrefs

Programs

  • Mathematica
    fasmax[y_]:=Complement[y,Union@@(Most[Subsets[#]]&)/@y];
    Table[Length[fasmax[Select[Subsets[Range[n]],MemberQ[#,n]&&UnsameQ@@Plus@@@Subsets[#]&]]],{n,15}]
  • Python
    def f(p0, n, m, cm):
        full, t, p = True, 0, p0
        while p>k)&1)==0 and ((m<Bert Dobbelaere, Mar 07 2021

Extensions

More terms from Bert Dobbelaere, Mar 07 2021

A059519 Number of partitions of n all of whose subpartitions sum to distinct values. Partition(n) = [a, b, c...] where 2n = 2^a + 2^b + 2^c + ...

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 8, 9, 10, 11, 12, 14, 16, 17, 18, 19, 20, 21, 24, 26, 28, 32, 33, 34, 35, 36, 37, 38, 40, 41, 44, 48, 50, 52, 56, 64, 65, 66, 67, 68, 69, 70, 72, 73, 74, 80, 81, 84, 88, 96, 98, 100, 104, 112, 116, 128, 129, 130, 131, 132, 133, 134, 136, 137, 138, 139, 140
Offset: 1

Views

Author

Marc LeBrun, Jan 19 2001

Keywords

Comments

Partition encoding as in A029931. Complement of A059520.
From Gus Wiseman, Jul 22 2019: (Start)
These are numbers whose positions of 1's in their reversed binary expansion form a strict knapsack partition (A275972). The initial terms together with their corresponding partitions are:
1: (1)
2: (2)
3: (2,1)
4: (3)
5: (3,1)
6: (3,2)
8: (4)
9: (4,1)
10: (4,2)
11: (4,2,1)
12: (4,3)
14: (4,3,2)
16: (5)
17: (5,1)
18: (5,2)
19: (5,2,1)
20: (5,3)
(End)

Examples

			14=2+4+8 so Partition(14) = [2,3,4], whose sub-sums are 0,2,3,4,5,6,7 and 14.
		

Crossrefs

Other sequences classifying numbers by their binary indices: A291166 (relatively prime), A295235 (arithmetic progression), A326669 (integer average), A326675 (pairwise coprime).

Programs

  • Mathematica
    bpe[n_]:=Join@@Position[Reverse[IntegerDigits[n,2]],1];
    Select[Range[100],UnsameQ@@Total/@Subsets[bpe[#]]&] (* Gus Wiseman, Jul 22 2019 *)

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

A326018 Heinz numbers of knapsack partitions such that no addition of one part up to the maximum is knapsack.

Original entry on oeis.org

1925, 12155, 20995, 23375, 37145
Offset: 1

Views

Author

Gus Wiseman, Jun 03 2019

Keywords

Comments

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 submultiset has a different sum.
The enumeration of these partitions by sum is given by A326016.

Examples

			The sequence of terms together with their prime indices begins:
   1925: {3,3,4,5}
  12155: {3,5,6,7}
  20995: {3,6,7,8}
  23375: {3,3,3,5,7}
  37145: {3,7,8,9}
		

Crossrefs

Programs

  • Mathematica
    ksQ[y_]:=UnsameQ@@Total/@Union[Subsets[y]];
    Select[Range[2,200],With[{phm=If[#==1,{},Flatten[Cases[FactorInteger[#],{p_,k_}:>Table[PrimePi[p],{k}]]]]},ksQ[phm]&&Select[Table[Sort[Append[phm,i]],{i,Max@@phm}],ksQ]=={}]&]

A326035 Number of uniform knapsack partitions of n.

Original entry on oeis.org

1, 1, 2, 3, 4, 4, 6, 6, 9, 10, 12, 12, 17, 16, 20, 25, 27, 29, 35, 39, 44, 57, 53, 66, 75, 84, 84, 114, 112, 131, 133, 162, 167, 209, 192, 242, 250, 289, 279, 363, 348, 417, 404, 502, 487, 608, 557, 706, 682, 835, 773, 1004, 922, 1149, 1059, 1344, 1257, 1595
Offset: 0

Views

Author

Gus Wiseman, Jun 04 2019

Keywords

Comments

An integer partition is uniform if all parts appear with the same multiplicity, and knapsack if every distinct submultiset has a different sum.

Examples

			The a(1) = 1 through a(8) = 9 partitions:
  (1)  (2)   (3)    (4)     (5)      (6)       (7)        (8)
       (11)  (21)   (22)    (32)     (33)      (43)       (44)
             (111)  (31)    (41)     (42)      (52)       (53)
                    (1111)  (11111)  (51)      (61)       (62)
                                     (222)     (421)      (71)
                                     (111111)  (1111111)  (521)
                                                          (2222)
                                                          (3311)
                                                          (11111111)
		

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

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