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-10 of 12 results. Next

A304793 Number of distinct positive subset-sums of the integer partition with Heinz number n.

Original entry on oeis.org

0, 1, 1, 2, 1, 3, 1, 3, 2, 3, 1, 4, 1, 3, 3, 4, 1, 5, 1, 5, 3, 3, 1, 5, 2, 3, 3, 5, 1, 6, 1, 5, 3, 3, 3, 6, 1, 3, 3, 6, 1, 7, 1, 5, 5, 3, 1, 6, 2, 5, 3, 5, 1, 7, 3, 7, 3, 3, 1, 7, 1, 3, 4, 6, 3, 7, 1, 5, 3, 6, 1, 7, 1, 3, 5, 5, 3, 7, 1, 7, 4, 3, 1, 8, 3, 3, 3, 7, 1, 8, 3, 5, 3, 3, 3, 7, 1, 5, 5, 8, 1, 7, 1, 7, 7
Offset: 1

Views

Author

Gus Wiseman, May 18 2018

Keywords

Comments

A positive integer n is a positive subset-sum of an integer partition y if there exists a submultiset of y with sum n. The Heinz number of an integer partition (y_1,...,y_k) is prime(y_1)*...*prime(y_k).
a(n) <= A000005(n).
One less than the number of distinct values obtained when A056239 is applied to all divisors of n. - Antti Karttunen, Jul 01 2018

Examples

			The positive subset-sums of (4,3,1) are {1, 3, 4, 5, 7, 8} so a(70) = 6.
The positive subset-sums of (5,1,1,1) are {1, 2, 3, 5, 6, 7, 8} so a(88) = 7.
		

Crossrefs

Programs

  • Mathematica
    Table[Length[Union[Total/@Rest[Subsets[Join@@Cases[FactorInteger[n],{p_,k_}:>Table[PrimePi[p],{k}]]]]]],{n,100}]
  • PARI
    up_to = 65537;
    A056239(n) = { my(f); if(1==n, 0, f=factor(n); sum(i=1, #f~, f[i,2] * primepi(f[i,1]))); }
    v056239 = vector(up_to,n,A056239(n));
    A304793(n) = { my(m=Map(),s,k=0); fordiv(n,d,if(!mapisdefined(m,s = v056239[d]), mapput(m,s,s); k++)); (k-1); }; \\ Antti Karttunen, Jul 01 2018

Extensions

More terms from Antti Karttunen, Jul 01 2018

A301957 Number of distinct subset-products of the integer partition with Heinz number n.

Original entry on oeis.org

1, 1, 2, 1, 2, 2, 2, 1, 3, 2, 2, 2, 2, 2, 4, 1, 2, 3, 2, 2, 4, 2, 2, 2, 3, 2, 4, 2, 2, 4, 2, 1, 4, 2, 4, 3, 2, 2, 4, 2, 2, 4, 2, 2, 6, 2, 2, 2, 3, 3, 4, 2, 2, 4, 4, 2, 4, 2, 2, 4, 2, 2, 5, 1, 4, 4, 2, 2, 4, 4, 2, 3, 2, 2, 6, 2, 4, 4, 2, 2, 5, 2, 2, 4, 4, 2, 4, 2, 2, 6, 4, 2, 4, 2, 4, 2, 2, 3, 6, 3, 2, 4, 2, 2, 8
Offset: 1

Views

Author

Gus Wiseman, Mar 29 2018

Keywords

Comments

A subset-product of an integer partition y is a product of some submultiset of y. The Heinz number of an integer partition (y_1,...,y_k) is prime(y_1)*...*prime(y_k).
Number of distinct values obtained when A003963 is applied to all divisors of n. - Antti Karttunen, Sep 05 2018

Examples

			The distinct subset-products of (4,2,1,1) are 1, 2, 4, and 8, so a(84) = 4.
The distinct subset-products of (6,3,2) are 1, 2, 3, 6, 12, 18, and 36, so a(195) = 7.
		

Crossrefs

Programs

  • Mathematica
    Table[If[n===1,1,Length[Union[Times@@@Subsets[Join@@Cases[FactorInteger[n],{p_,k_}:>Table[PrimePi[p],{k}]]]]]],{n,100}]
  • PARI
    up_to = 65537;
    A003963(n) = { n=factor(n); n[, 1]=apply(primepi, n[, 1]); factorback(n) }; \\ From A003963
    v003963 = vector(up_to,n,A003963(n));
    A301957(n) = { my(m=Map(),s,k=0,c); fordiv(n,d,if(!mapisdefined(m,s = v003963[d],&c), mapput(m,s,s); k++)); (k); }; \\ Antti Karttunen, Sep 05 2018

Extensions

More terms from Antti Karttunen, Sep 05 2018

A301854 Number of positive special sums of integer partitions of n.

Original entry on oeis.org

1, 3, 7, 13, 25, 40, 67, 100, 158, 220, 336, 452, 649, 862, 1228, 1553, 2155, 2738, 3674, 4612, 6124, 7497, 9857, 12118, 15524, 18821, 24152, 28863, 36549, 44002, 54576, 65125, 80943, 95470, 117991, 139382, 169389, 199144, 242925, 283353, 342139, 400701, 479001
Offset: 1

Views

Author

Gus Wiseman, Mar 27 2018

Keywords

Comments

A positive special sum of an integer partition y is a number n > 0 such that exactly one submultiset of y sums to n.

Examples

			The a(4) = 13 special positive subset-sums:
1<=(1111), 2<=(1111), 3<=(1111), 4<=(1111),
1<=(211),  3<=(211),  4<=(211),
1<=(31),   3<=(31),   4<=(31),
2<=(22),   4<=(22),
4<=(4).
		

Crossrefs

Programs

  • Mathematica
    uqsubs[y_]:=Join@@Select[GatherBy[Union[Rest[Subsets[y]]],Total],Length[#]===1&];
    Table[Total[Length/@uqsubs/@IntegerPartitions[n]],{n,25}]
  • Python
    from collections import Counter
    from sympy.utilities.iterables import partitions, multiset_combinations
    def A301854(n): return sum(sum(1 for r in Counter(sum(q) for l in range(1,len(p)+1) for q in multiset_combinations(p,l)).values() if r==1) for p in (tuple(Counter(x).elements()) for x in partitions(n))) # Chai Wah Wu, Sep 26 2023

Extensions

a(21)-a(35) from Alois P. Heinz, Apr 08 2018
a(36)-a(43) from Chai Wah Wu, Sep 26 2023

A305611 Number of distinct positive subset-sums of the multiset of prime factors of n.

Original entry on oeis.org

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

Views

Author

Gus Wiseman, Jun 06 2018

Keywords

Comments

An integer n is a positive subset-sum of a multiset y if there exists a nonempty submultiset of y with sum n.
One less than the number of distinct values obtained when A001414 is applied to all divisors of n. - Antti Karttunen, Jun 13 2018

Examples

			The a(12) = 5 positive subset-sums of {2, 2, 3} are 2, 3, 4, 5, and 7.
		

Crossrefs

Programs

  • Mathematica
    Table[Length[Union[Total/@Rest[Subsets[Join@@Cases[FactorInteger[n],{p_,k_}:>Table[p,{k}]]]]]],{n,100}]
  • PARI
    up_to = 65537;
    A001414(n) = ((n=factor(n))[, 1]~*n[, 2]); \\ From A001414.
    v001414 = vector(up_to,n,A001414(n));
    A305611(n) = { my(m=Map(),s,k=0); fordiv(n,d,if(!mapisdefined(m,s = v001414[d]), mapput(m,s,s); k++)); (k-1); }; \\ Antti Karttunen, Jun 13 2018
    
  • Python
    from sympy import factorint
    from sympy.utilities.iterables import multiset_combinations
    def A305611(n):
        fs = factorint(n)
        return len(set(sum(d) for i in range(1,sum(fs.values())+1) for d in multiset_combinations(fs,i))) # Chai Wah Wu, Aug 23 2021

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

A301979 Number of subset-sums minus number of subset-products of the integer partition with Heinz number n.

Original entry on oeis.org

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

Views

Author

Gus Wiseman, Mar 30 2018

Keywords

Comments

The Heinz number of an integer partition (y_1,...,y_k) is prime(y_1)*...*prime(y_k). A subset-sum (or subset-product) of a multiset y is any number equal to the sum (or product) of some submultiset of y.
First negative entry is a(165) = -1.
This sequence is unbounded above and below.

Examples

			The distinct subset-sums of (4,2,1,1) are 0, 1, 2, 3, 4, 5, 6, 7, 8, while the distinct subset-products are 1, 2, 4, 8, so a(84) = 9 - 4 = 5.
The distinct subset-sums of (5,3,2) are 0, 2, 3, 5, 7, 8, 10, while the distinct subset-products are 1, 2, 3, 5, 6, 10, 15, 30, so a(165) = 7 - 8 = -1.
		

Crossrefs

Programs

  • Mathematica
    Table[With[{ptn=If[n===1,{},Join@@Cases[FactorInteger[n],{p_,k_}:>Table[PrimePi[p],{k}]]]},Length[Union[Plus@@@Subsets[ptn]]]-Length[Union[Times@@@Subsets[ptn]]]],{n,100}]
  • PARI
    A003963(n) = {n=factor(n); n[, 1]=apply(primepi, n[, 1]); factorback(n)};
    A301957(n) = {my(ds = divisors(n)); for(i=1,#ds,ds[i] = A003963(ds[i])); #Set(ds)};
    A056239(n) = if(1==n,0,my(f=factor(n)); sum(i=1, #f~, f[i,2] * primepi(f[i,1])));
    A299701(n) = {my(ds = divisors(n)); for(i=1,#ds,ds[i] = A056239(ds[i])); #Set(ds)};
    A301979(n) = (A299701(n) - A301957(n)); \\ Antti Karttunen, Oct 07 2018

Formula

a(n) = A299701(n) - A301957(n).

A301934 Number of positive subset-sum trees of weight n.

Original entry on oeis.org

1, 3, 14, 85, 586, 4331, 33545, 268521, 2204249
Offset: 1

Views

Author

Gus Wiseman, Mar 28 2018

Keywords

Comments

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 weight is the sum of the 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.

Examples

			The a(3) = 14 positive subset-sum trees:
3           3(1,2)       3(1,1,1)     3(1,2(1,1))
2(1,2)      2(1,1,1)     2(1,1(1,1))  2(1(1,1),1)  2(1,2(1,1))
1(1,2)      1(1,1,1)     1(1,1(1,1))  1(1(1,1),1)  1(1,2(1,1))
		

Crossrefs

A319353 Filter sequence combining weights of partitions with Heinz-numbers equal to the proper divisors of n.

Original entry on oeis.org

1, 2, 2, 3, 2, 4, 2, 4, 5, 6, 2, 7, 2, 8, 9, 10, 2, 11, 2, 11, 12, 13, 2, 14, 15, 16, 12, 17, 2, 18, 2, 11, 19, 20, 21, 22, 2, 23, 24, 18, 2, 25, 2, 26, 27, 28, 2, 29, 30, 31, 32, 33, 2, 25, 34, 25, 35, 36, 2, 37, 2, 38, 39, 40, 41, 42, 2, 43, 44, 45, 2, 37, 2, 46, 47, 48, 49, 50, 2, 51, 52, 53, 2, 54, 55, 56, 57, 42, 2, 58, 59, 60, 61, 62, 63, 37, 2, 64, 65
Offset: 1

Views

Author

Antti Karttunen, Sep 17 2018

Keywords

Comments

Restricted growth sequence transform of A319352.
For all i, j:
a(i) = a(j) => A301855(i) = A301855(j).
a(i) = a(j) => A304793(i) = A304793(j).

Crossrefs

Programs

  • PARI
    up_to = 65537;
    rgs_transform(invec) = { my(om = Map(), outvec = vector(length(invec)), u=1); for(i=1, length(invec), if(mapisdefined(om,invec[i]), my(pp = mapget(om, invec[i])); outvec[i] = outvec[pp] , mapput(om,invec[i],i); outvec[i] = u; u++ )); outvec; };
    A056239(n) = { my(f); if(1==n, 0, f=factor(n); sum(i=1, #f~, f[i,2] * primepi(f[i,1]))); }
    A319352(n) = { my(m=1); fordiv(n, d, if(dA056239(d)))); (m); };
    v319353 = rgs_transform(vector(up_to,n,A319352(n)));
    A319353(n) = v319353[n];

A319352 a(n) = Product_{d|n, dA056239(d)), where A056239(d) gives the weight of the partition whose Heinz-number is d.

Original entry on oeis.org

1, 2, 2, 6, 2, 30, 2, 30, 10, 42, 2, 1050, 2, 66, 70, 210, 2, 2310, 2, 2310, 110, 78, 2, 80850, 14, 102, 110, 4290, 2, 210210, 2, 2310, 130, 114, 154, 1651650, 2, 138, 170, 210210, 2, 510510, 2, 6630, 10010, 174, 2, 11561550, 22, 7854, 190, 9690, 2, 510510, 182, 510510, 230, 186, 2, 2555102550, 2, 222, 20570, 30030, 238, 881790, 2
Offset: 1

Views

Author

Antti Karttunen, Sep 17 2018

Keywords

Crossrefs

Cf. A056239, A319353 (rgs-transform).

Programs

  • PARI
    A056239(n) = { my(f); if(1==n, 0, f=factor(n); sum(i=1, #f~, f[i,2] * primepi(f[i,1]))); }
    A319352(n) = { my(m=1); fordiv(n, d, if(dA056239(d)))); (m); };

Formula

a(n) = Product_{d|n, dA056239(d)).
For all n >= 1:
A001221(a(n)) = A304793(n).
A001222(a(n)) = A032741(n).
1+A056169(a(n)) = A301855(n).

A301970 Heinz numbers of integer partitions with more subset-products than subset-sums.

Original entry on oeis.org

165, 273, 325, 351, 495, 525, 561, 595, 675, 741, 765, 819, 825, 931, 1045, 1053, 1155, 1173, 1425, 1485, 1495, 1575, 1625, 1653, 1683, 1771, 1785, 1815, 1911, 2025, 2139, 2145, 2223, 2275, 2277, 2295, 2310, 2415, 2457, 2465, 2475, 2625, 2639, 2695, 2805, 2945
Offset: 1

Views

Author

Gus Wiseman, Mar 29 2018

Keywords

Comments

The Heinz number of an integer partition (y_1,...,y_k) is prime(y_1)*...*prime(y_k). A subset-sum (or subset-product) of a multiset y is any number equal to the sum (or product) of some submultiset of y.
Numbers n such that A301957(n) > A299701(n).

Examples

			Sequence of partitions begins: (532), (642), (633), (6222), (5322), (4332), (752), (743), (33222), (862), (7322), (6422), (5332), (844), (853), (62222), (5432), (972), (8332), (53222), (963), (43322), (6333).
		

Crossrefs

Programs

  • Mathematica
    Select[Range[1000],With[{ptn=If[#===1,{},Join@@Cases[FactorInteger[#],{p_,k_}:>Table[PrimePi[p],{k}]]]},Length[Union[Times@@@Subsets[ptn]]]>Length[Union[Plus@@@Subsets[ptn]]]]&]
Showing 1-10 of 12 results. Next