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

A304792 Number of subset-sums of integer partitions of n.

Original entry on oeis.org

1, 2, 5, 10, 19, 34, 58, 96, 152, 240, 361, 548, 795, 1164, 1647, 2354, 3243, 4534, 6150, 8420, 11240, 15156, 19938, 26514, 34513, 45260, 58298, 75704, 96515, 124064, 157072, 199894, 251097, 317278, 395625, 496184, 615229, 765836, 944045, 1168792, 1432439
Offset: 0

Views

Author

Gus Wiseman, May 18 2018

Keywords

Comments

For a multiset p of positive integers summing to n, a pair (t,p) is defined to be a subset sum if there exists a submultiset of p summing to t. This sequence is dominated by A122768 + A000041 (number of submultisets of integer partitions of n).

Examples

			The a(4)=19 subset sums are (0,4), (4,4), (0,31), (1,31), (3,31), (4,31), (0,22), (2,22), (4,22), (0,211), (1,211), (2,211), (3,211), (4,211), (0,1111), (1,1111), (2,1111), (3,1111), (4,1111).
		

Crossrefs

Programs

  • Maple
    b:= proc(n, i, s) option remember; `if`(n=0, nops(s),
         `if`(i<1, 0, b(n, i-1, s)+b(n-i, min(n-i, i),
          map(x-> [x, x+i][], s))))
        end:
    a:= n-> b(n$2, {0}):
    seq(a(n), n=0..40);  # Alois P. Heinz, May 18 2018
  • Mathematica
    Table[Total[Length[Union[Total/@Subsets[#]]]&/@IntegerPartitions[n]],{n,15}]
    (* Second program: *)
    b[n_, i_, s_] := b[n, i, s] = If[n == 0, Length[s],
         If[i < 1, 0, b[n, i - 1, s] + b[n - i, Min[n - i, i],
         {#, # + i}& /@ s // Flatten // Union]]];
    a[n_] := b[n, n, {0}];
    a /@ Range[0, 40] (* Jean-François Alcover, May 20 2021, after Alois P. Heinz *)
  • Python
    from functools import lru_cache
    @lru_cache(maxsize=None)
    def A304792_T(n,i,s,l):
        if n==0: return l
        if i<1: return 0
        return A304792_T(n,i-1,s,l)+A304792_T(n-i,min(n-i,i),(t:=tuple(sorted(set(s+tuple(x+i for x in s))))),len(t))
    def A304792(n): return A304792_T(n,n,(0,),1) # Chai Wah Wu, Sep 25 2023, after Alois P. Heinz

Formula

a(n) = A276024(n) + A000041(n).

A301935 Number of positive subset-sum trees whose composite a positive subset-sum of the integer partition with Heinz number n.

Original entry on oeis.org

0, 1, 1, 2, 1, 3, 1, 10, 2, 3, 1, 21, 1, 3, 3, 58, 1, 21, 1, 21, 3, 3, 1, 164, 2, 3, 10, 21, 1, 34, 1, 373, 3, 3, 3, 218, 1, 3, 3, 161, 1, 7, 1, 5, 5, 3, 1, 1320, 2, 5, 3, 5, 1, 7, 3, 7, 3, 3, 1, 7, 1, 3, 4, 2558, 3, 7, 1, 5, 3, 6, 1, 7
Offset: 1

Views

Author

Gus Wiseman, Mar 28 2018

Keywords

Comments

The Heinz number of an integer partition (y_1,...,y_k) is prime(y_1)*...*prime(y_k). A positive subset-sum tree with root x is either the symbol x itself, or is obtained by first choosing a positive subset-sum x <= (y_1,...,y_k) with k > 1 and then choosing a positive subset-sum tree with root y_i for each i = 1...k. The composite of a positive subset-sum tree is the positive subset-sum x <= g where x is the root sum and g is the multiset of leaves. We write positive subset-sum trees in the form rootsum(branch,...,branch). For example, 4(1(1,3),2,2(1,1)) is a positive subset-sum tree with composite 4(1,1,1,2,3) and weight 8.

Crossrefs

A316223 Number of subset-sum triangles with composite a subset-sum of the integer partition with Heinz number n.

Original entry on oeis.org

0, 1, 1, 4, 1, 6, 1, 13, 4, 6, 1, 25, 1, 6, 6, 38, 1, 26, 1, 26, 6, 6
Offset: 1

Views

Author

Gus Wiseman, Jun 27 2018

Keywords

Comments

A positive subset-sum is a pair (h,g), where h is a positive integer and g is an integer partition, such that some submultiset of g sums to h. A triangle consists of a root sum r and a sequence of positive subset-sums ((h_1,g_1),...,(h_k,g_k)) such that the sequence (h_1,...,h_k) is weakly decreasing and has a submultiset summing to r. The composite of a triangle is (r, g_1 + ... + g_k) where + is multiset union.

Examples

			We write positive subset-sum triangles in the form rootsum(branch,...,branch). The a(8) = 13 triangles:
  1(1(1,1,1))
  2(2(1,1,1))
  3(3(1,1,1))
  1(1(1),1(1,1))
  2(1(1),1(1,1))
  1(1(1),2(1,1))
  2(1(1),2(1,1))
  3(1(1),2(1,1))
  1(1(1,1),1(1))
  2(1(1,1),1(1))
  1(1(1),1(1),1(1))
  2(1(1),1(1),1(1))
  3(1(1),1(1),1(1))
		

Crossrefs

A316222 Number of positive subset-sum triangles whose composite is a positive subset-sum of an integer partition of n.

Original entry on oeis.org

1, 5, 20, 74, 258, 855, 2736, 8447
Offset: 1

Views

Author

Gus Wiseman, Jun 27 2018

Keywords

Comments

A positive subset-sum is a pair (h,g), where h is a positive integer and g is an integer partition, such that some submultiset of g sums to h. A triangle consists of a root sum r and a sequence of positive subset-sums ((h_1,g_1),...,(h_k,g_k)) such that the sequence (h_1,...,h_k) is weakly decreasing and has a submultiset summing to r.

Examples

			We write positive subset-sum triangles in the form rootsum(branch,...,branch). The a(2) = 5 positive subset-sum triangles:
  2(2(2))
  1(1(1,1))
  2(2(1,1))
  1(1(1),1(1))
  2(1(1),1(1))
		

Crossrefs

Showing 1-4 of 4 results.