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 16 results. Next

A048249 Number of distinct values produced from sums and products of n unity arguments.

Original entry on oeis.org

1, 2, 3, 4, 6, 9, 11, 17, 23, 30, 44, 60, 80, 114, 156, 212, 296, 404, 556, 770, 1065, 1463, 2032, 2795, 3889, 5364, 7422, 10300, 14229, 19722, 27391, 37892, 52599, 73075, 101301, 140588, 195405, 271024, 376608, 523518, 726812, 1010576, 1405013, 1952498
Offset: 1

Views

Author

Keywords

Comments

Values listed calculated by exhaustive search algorithm.
For n+1 operands (n operations) there are (2n)!/((n!)((n+1)!)) possible postfix forms over a single operator. For each such form, there are 2^n ways to assign 2 operators (here, sum and product). Calculate results and eliminate duplicates.
Number of distinct positive integers that can be obtained by iteratively adding or multiplying together parts of an integer partition until only one part remains, starting with 1^n. - Gus Wiseman, Sep 29 2018

Examples

			a(3)=3 since (in postfix): 111** = 11*1* = 1, 111*+ = 11*1+ = 111+* = 11+1* = 2 and 111++ = 11+1+ = 3. Note that at n=7, the 11 possible values produced are the set {1,2,3,4,5,6,7,8,9,10,12}. This is the first n for which there are "skipped" values in the set.
		

Crossrefs

Programs

  • Maple
    b:= proc(n) option remember; `if`(n=1, {1}, {seq(seq(seq(
         [f+g, f*g][], g=b(n-i)), f=b(i)), i=1..iquo(n, 2))})
        end:
    a:= n-> nops(b(n)):
    seq(a(n), n=1..35);  # Alois P. Heinz, May 05 2019
  • Mathematica
    ReplaceListRepeated[forms_,rerules_]:=Union[Flatten[FixedPointList[Function[pre,Union[Flatten[ReplaceList[#,rerules]&/@pre,1]]],forms],1]];
    Table[Length[Select[ReplaceListRepeated[{Array[1&,n]},{{foe___,x_,mie___,y_,afe___}:>Sort[Append[{foe,mie,afe},x+y]],{foe___,x_,mie___,y_,afe___}:>Sort[Append[{foe,mie,afe},x*y]]}],Length[#]==1&]],{n,10}] (* Gus Wiseman, Sep 29 2018 *)
  • Python
    from functools import cache
    @cache
    def f(m):
        if m == 1: return {1}
        out = set()
        for j in range(1, m//2+1):
            for x in f(j):
                for y in f(m-j):
                    out.update([x + y, x * y])
        return out
    def a(n): return len(f(n))
    print([a(n) for n in range(1, 40)]) # Michael S. Branicky, Aug 03 2022

Formula

Equals partial sum of "number of numbers of complexity n" (A005421). - Jonathan Vos Post, Apr 07 2006

Extensions

More terms from David W. Wilson, Oct 10 2001
a(43)-a(44) from Alois P. Heinz, May 05 2019

A319913 Number of distinct integer partitions whose parts can be combined together using additions and multiplications to obtain n, with the exception that 1's can only be added and not multiplied with other parts.

Original entry on oeis.org

1, 2, 3, 5, 7, 16, 20, 37, 53, 81, 107, 177, 227, 332, 449, 647, 830, 1162, 1480, 2032, 2597, 3447, 4348, 5775, 7251, 9374, 11758, 15026, 18640, 23688, 29220, 36771, 45128, 56168, 68674, 85015, 103394, 126923, 153871, 187911, 226653
Offset: 1

Views

Author

Gus Wiseman, Oct 01 2018

Keywords

Comments

All parts of the integer partition must be used in such a combination.

Examples

			The a(7) = 20 partitions (which are not all partitions of 7):
  (7),
  (61), (52), (43),
  (511), (321), (421), (331), (322),
  (3111), (4111), (2211), (3211), (2221),
  (21111), (31111), (22111),
  (111111), (211111),
  (1111111).
This list contains (2211) because we can write 7 = (2+1)*2+1. It contains (321) because we can write 7 = 3*2+1, even though the sum of parts is only 6.
		

Crossrefs

Formula

a(n) >= A000041(n).
a(n) >= A001055(n).

Extensions

a(13)-a(41) from Charlie Neder, Jun 02 2019

A267597 Number of sum-product knapsack partitions of n. Number of integer partitions y of n such that every sum of products of the parts of a multiset partition of any submultiset of y is distinct.

Original entry on oeis.org

1, 1, 1, 1, 1, 2, 3, 3, 4, 4, 6, 7, 8, 12, 12, 14, 18, 23, 23, 32, 30, 35, 50, 48, 47, 56, 80, 77, 87, 105, 100, 134, 139, 145, 194, 170, 192, 250
Offset: 0

Views

Author

Gus Wiseman, Oct 04 2018

Keywords

Examples

			The sequence of product-sum knapsack partitions begins:
   0: ()
   1: (1)
   2: (2)
   3: (3)
   4: (4)
   5: (5) (3,2)
   6: (6) (4,2) (3,3)
   7: (7) (5,2) (4,3)
   8: (8) (6,2) (5,3) (4,4)
   9: (9) (7,2) (6,3) (5,4)
  10: (10) (8,2) (7,3) (6,4) (5,5) (4,3,3)
  11: (11) (9,2) (8,3) (7,4) (6,5) (5,4,2) (5,3,3)
The partition (4,4,3) is not a sum-product knapsack partition of 11 because (4*4) = (4)+(4*3).
A complete list of all sums of products of multiset partitions of submultisets of (5,4,2) is:
            0 = 0
          (2) = 2
          (4) = 4
          (5) = 5
        (2*4) = 8
        (2*5) = 10
        (4*5) = 20
      (2*4*5) = 40
      (2)+(4) = 6
      (2)+(5) = 7
    (2)+(4*5) = 22
      (4)+(5) = 9
    (4)+(2*5) = 14
    (5)+(2*4) = 13
  (2)+(4)+(5) = 11
These are all distinct, so (5,4,2) is a sum-product knapsack partition of 11.
		

Crossrefs

Programs

  • Mathematica
    sps[{}]:={{}};
    sps[set:{i_,_}]:=Join@@Function[s,Prepend[#,s]&/@sps[Complement[set,s]]]/@Cases[Subsets[set],{i,_}];
    mps[set_]:=Union[Sort[Sort/@(#/.x_Integer:>set[[x]])]&/@sps[Range[Length[set]]]];
    rrtuks[n_]:=Select[IntegerPartitions[n],Function[q,UnsameQ@@Apply[Plus,Apply[Times,Union@@mps/@Union[Subsets[q]],{2}],{1}]]];
    Table[Length[rrtuks[n]],{n,12}]

Extensions

a(13)-a(37) from Sean A. Irvine, Jul 13 2022

A320052 Number of product-sum knapsack partitions of n. Number of integer partitions y of n such that every product of sums of the parts of a multiset partition of any submultiset of y is distinct.

Original entry on oeis.org

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

Views

Author

Gus Wiseman, Oct 04 2018

Keywords

Examples

			The sequence of product-sum knapsack partitions begins:
   0: ()
   1:
   2: (2)
   3: (3)
   4: (4)
   5: (5) (3,2)
   6: (6) (4,2) (3,3)
   7: (7) (5,2) (4,3)
   8: (8) (6,2) (5,3) (4,4)
   9: (9) (7,2) (6,3) (5,4)
  10: (10) (8,2) (7,3) (6,4) (5,5) (4,3,3)
  11: (11) (9,2) (8,3) (7,4) (6,5) (5,4,2) (5,3,3) (4,4,3)
  12: (12) (10,2) (9,3) (8,4) (7,5) (7,3,2) (6,6) (4,4,4)
A complete list of all products of sums of multiset partitions of submultisets of (4,3,3) is:
           () = 1
          (3) = 3
          (4) = 4
        (3+3) = 6
        (3+4) = 7
      (3+3+4) = 10
      (3)*(3) = 9
      (3)*(4) = 12
    (3)*(3+4) = 21
    (4)*(3+3) = 24
  (3)*(3)*(4) = 36
These are all distinct, so (4,3,3) is a product-sum knapsack partition of 10.
		

Crossrefs

Programs

  • Mathematica
    sps[{}]:={{}};
    sps[set:{i_,_}]:=Join@@Function[s,Prepend[#,s]&/@sps[Complement[set,s]]]/@Cases[Subsets[set],{i,_}];
    mps[set_]:=Union[Sort[Sort/@(#/.x_Integer:>set[[x]])]&/@sps[Range[Length[set]]]];
    rrsuks[n_]:=Select[IntegerPartitions[n],Function[q,UnsameQ@@Apply[Times,Apply[Plus,Union@@mps/@Union[Subsets[q]],{2}],{1}]]];
    Table[Length[rrsuks[n]],{n,12}]

A320053 Number of spanning sum-product knapsack partitions of n. Number of integer partitions y of n such that every sum of products of the parts of a multiset partition of y is distinct.

Original entry on oeis.org

1, 1, 2, 3, 2, 3, 4, 5, 6, 8, 9, 12, 14
Offset: 0

Views

Author

Gus Wiseman, Oct 04 2018

Keywords

Examples

			The sequence of spanning sum-product knapsack partitions begins:
  0: ()
  1: (1)
  2: (2) (1,1)
  3: (3) (2,1) (1,1,1)
  4: (4) (3,1)
  5: (5) (4,1) (3,2)
  6: (6) (5,1) (4,2) (3,3)
  7: (7) (6,1) (5,2) (4,3) (3,3,1)
  8: (8) (7,1) (6,2) (5,3) (4,4) (3,3,2)
  9: (9) (8,1) (7,2) (6,3) (5,4) (4,4,1) (4,3,2) (3,3,3)
A complete list of all sums of products covering the parts of (3,3,3,2) is:
        (2*3*3*3) = 54
      (2)+(3*3*3) = 29
      (3)+(2*3*3) = 21
      (2*3)+(3*3) = 15
    (2)+(3)+(3*3) = 14
    (3)+(3)+(2*3) = 12
  (2)+(3)+(3)+(3) = 11
These are all distinct, so (3,3,3,2) is a spanning sum-product knapsack partition of 11.
An example of a spanning sum-product knapsack partition that is not a spanning product-sum knapsack partition is (5,4,3,2).
		

Crossrefs

Programs

  • Mathematica
    sps[{}]:={{}};
    sps[set:{i_,_}]:=Join@@Function[s,Prepend[#,s]&/@sps[Complement[set,s]]]/@Cases[Subsets[set],{i,_}];
    mps[set_]:=Union[Sort[Sort/@(#/.x_Integer:>set[[x]])]&/@sps[Range[Length[set]]]];
    rtuks[n_]:=Select[IntegerPartitions[n],Function[q,UnsameQ@@Apply[Plus,Apply[Times,mps[q],{2}],{1}]]];
    Table[Length[rtuks[n]],{n,8}]

A320054 Number of spanning product-sum knapsack partitions of n. Number of integer partitions y of n such that every product of sums the parts of a multiset partition of y is distinct.

Original entry on oeis.org

1, 1, 2, 3, 2, 4, 5, 8, 10, 12, 16, 17, 25
Offset: 0

Views

Author

Gus Wiseman, Oct 04 2018

Keywords

Examples

			The sequence of spanning product-sum knapsack partitions begins
0: ()
1: (1)
2: (2) (1,1)
3: (3) (2,1) (1,1,1)
4: (4) (3,1)
5: (5) (4,1) (3,2) (3,1,1)
6: (6) (5,1) (4,2) (4,1,1) (3,3)
7: (7) (6,1) (5,2) (5,1,1) (4,3) (4,2,1) (4,1,1,1) (3,3,1)
8: (8) (7,1) (6,2) (6,1,1) (5,3) (5,2,1) (5,1,1,1) (4,4) (4,3,1) (3,3,2)
9: (9) (8,1) (7,2) (7,1,1) (6,3) (6,2,1) (6,1,1,1) (5,4) (5,3,1) (4,4,1) (4,3,2) (3,3,3)
A complete list of all products of sums covering the parts of (4,1,1,1) is:
        (1+1+1+4) = 7
      (1)*(1+1+4) = 6
      (4)*(1+1+1) = 12
      (1+1)*(1+4) = 10
    (1)*(1)*(1+4) = 5
    (1)*(4)*(1+1) = 8
  (1)*(1)*(1)*(4) = 4
These are all distinct, so (4,1,1,1) is a spanning product-sum knapsack partition of 7.
A complete list of all products of sums covering the parts of (5,3,1,1) is:
        (1+1+3+5) = 10
      (1)*(1+3+5) = 9
      (3)*(1+1+5) = 21
      (5)*(1+1+3) = 25
      (1+1)*(3+5) = 16
      (1+3)*(1+5) = 24
    (1)*(1)*(3+5) = 8
    (1)*(3)*(1+5) = 18
    (1)*(5)*(1+3) = 20
    (3)*(5)*(1+1) = 30
  (1)*(1)*(3)*(5) = 15
These are all distinct, so (5,3,1,1) is a spanning product-sum knapsack partition of 10.
An example of a spanning sum-product knapsack partition that is not a spanning product-sum knapsack partition is (5,4,3,2).
		

Crossrefs

Programs

  • Mathematica
    sps[{}]:={{}};
    sps[set:{i_,_}]:=Join@@Function[s,Prepend[#,s]&/@sps[Complement[set,s]]]/@Cases[Subsets[set],{i,_}];
    mps[set_]:=Union[Sort[Sort/@(#/.x_Integer:>set[[x]])]&/@sps[Range[Length[set]]]];
    rsuks[n_]:=Select[IntegerPartitions[n],Function[q,UnsameQ@@Apply[Times,Apply[Plus,mps[q],{2}],{1}]]];
    Table[Length[rsuks[n]],{n,10}]

A355383 Number of pairs (y, v), where y is a partition of n and v is a sub-multiset of y whose cardinality equals the number of distinct parts in y.

Original entry on oeis.org

1, 1, 2, 3, 6, 10, 16, 26, 42, 64, 100, 150, 224, 330, 482, 697, 999, 1418, 1996, 2794, 3879, 5355, 7343, 10018, 13583, 18338, 24618, 32917, 43790, 58043, 76591, 100716, 131906, 172194, 223966, 290423, 375318, 483668, 621368, 796138, 1017146
Offset: 0

Views

Author

Gus Wiseman, Jul 02 2022

Keywords

Comments

If a partition is regarded as an arrow from the number of parts to the number of distinct parts, this sequence counts composable containments of partitions.

Examples

			The a(0) = 1 through a(5) = 10 pairs:
  ()()  (1)(1)  (2)(2)   (3)(3)    (4)(4)     (5)(5)
                (11)(1)  (21)(21)  (31)(31)   (41)(41)
                         (111)(1)  (22)(2)    (32)(32)
                                   (211)(11)  (311)(11)
                                   (211)(21)  (311)(31)
                                   (1111)(1)  (221)(21)
                                              (221)(22)
                                              (2111)(11)
                                              (2111)(21)
                                              (11111)(1)
		

Crossrefs

With multiplicity we have A339006.
The version for compositions is A355384.
The homogeneous version w/o containment is A355385, compositions A355388.
A001970 counts multiset partitions of partitions.
A063834 counts partitions of each part of a partition.

Programs

  • Mathematica
    Table[Sum[Length[Union[Subsets[y,{Length[Union[y]]}]]],{y,IntegerPartitions[n]}],{n,0,15}]

A355385 Number of pairs (y, v) of integer partitions of n where the length of v equals the number of distinct parts in y.

Original entry on oeis.org

1, 1, 2, 3, 7, 12, 25, 43, 81, 141, 243, 409, 699, 1132, 1844, 2995, 4744, 7408, 11655, 17839, 27509, 41546, 62879, 93537, 139974, 205547, 302714, 440097, 640968, 921774, 1327538, 1891548, 2696635, 3809860, 5380257, 7540778, 10561566, 14687109, 20408170, 28183998, 38882009
Offset: 0

Views

Author

Gus Wiseman, Jul 02 2022

Keywords

Comments

Also the number of composable pairs of integer partitions of n, where a partition is regarded as an arrow from (number of parts) to (number of distinct parts). Is there a nice choice of a composition operation making this into an associative category?

Examples

			The a(0) = 1 through a(5) = 10 pairs:
  ()()  (1)(1)  (2)(2)   (3)(3)    (4)(4)     (5)(5)
                (11)(2)  (21)(21)  (31)(31)   (41)(41)
                         (111)(3)  (31)(22)   (41)(32)
                                   (22)(4)    (32)(41)
                                   (211)(31)  (32)(32)
                                   (211)(22)  (311)(41)
                                   (1111)(4)  (311)(32)
                                              (221)(41)
                                              (221)(32)
                                              (2111)(41)
                                              (2111)(32)
                                              (11111)(5)
		

Crossrefs

The inhomogeneous version with containment and multiplicity is A339006.
The inhomogeneous version with containment is A355383.
The inhomogeneous version with containment for compositions is A355384.
The version for compositions is A355388.
A001970 counts multiset partitions of partitions.
A063834 counts partitions of each part of a partition.
A323583 counts splittings of partitions.

Programs

  • Mathematica
    Table[Length[Select[Tuples[IntegerPartitions[n],2],Length[Union[#[[1]]]]==Length[#[[2]]]&]],{n,0,15}]
  • PARI
    \\ P gives A008284 and R gives A116608 as g.f.'s.
    P(n,y) = {1/prod(k=1, n, 1 - y*x^k + O(x*x^n))}
    R(n,y) = {prod(k=1, n, 1 + y/(1 - x^k) - y + O(x*x^n))}
    seq(n) = {my(g=Vec(P(n,y)), h=Vec(R(n,y))); vector(n+1, i, my(p=g[i], q=h[i]); sum(j=0, poldegree(q), polcoef(p,j)*polcoef(q,j)))} \\ Andrew Howroyd, Dec 31 2022

Formula

a(n) = Sum_{j >= 1} A116608(n,j) * A008284(n,j) for n > 0. - Andrew Howroyd, Dec 31 2022

Extensions

Terms a(26) and beyond from Andrew Howroyd, Dec 31 2022

A319912 Number of distinct pairs (m, y), where m >= 1 and y is an integer partition of n, such that m can be obtained by iteratively adding any two or multiplying any two non-1 parts of y until only one part (equal to m) remains.

Original entry on oeis.org

1, 2, 3, 5, 12, 30, 53, 128, 247, 493, 989, 1889, 3434, 6390, 11526, 20400, 35818, 62083, 106223, 180170
Offset: 1

Views

Author

Gus Wiseman, Oct 01 2018

Keywords

Examples

			The a(6) = 30 pairs:
  1 <= (1)
  2 <= (2)
  2 <= (1,1)
  3 <= (3)
  3 <= (2,1)
  3 <= (1,1,1)
  4 <= (4)
  4 <= (2,2)
  4 <= (3,1)
  4 <= (2,1,1)
  4 <= (1,1,1,1)
  5 <= (5)
  5 <= (3,2)
  5 <= (4,1)
  5 <= (2,2,1)
  5 <= (3,1,1)
  5 <= (2,1,1,1)
  5 <= (1,1,1,1,1)
  6 <= (6)
  6 <= (3,2)
  6 <= (3,3)
  6 <= (4,2)
  6 <= (5,1)
  6 <= (2,2,1)
  6 <= (2,2,2)
  6 <= (3,1,1)
  6 <= (3,2,1)
  6 <= (4,1,1)
  6 <= (2,1,1,1)
  6 <= (2,2,1,1)
  6 <= (3,1,1,1)
  6 <= (1,1,1,1,1)
  6 <= (2,1,1,1,1)
  6 <= (1,1,1,1,1,1)
		

Crossrefs

Programs

  • Mathematica
    ReplaceListRepeated[forms_,rerules_]:=Union[Flatten[FixedPointList[Function[pre,Union[Flatten[ReplaceList[#,rerules]&/@pre,1]]],forms],1]];
    mexos[ptn_]:=If[Length[ptn]==0,{0},Union@@Select[ReplaceListRepeated[{Sort[ptn]},{{foe___,x_,mie___,y_,afe___}:>Sort[Append[{foe,mie,afe},x+y]],{foe___,x_?(#>1&),mie___,y_?(#>1&),afe___}:>Sort[Append[{foe,mie,afe},x*y]]}],Length[#]==1&]];
    Table[Total[Length/@mexos/@IntegerPartitions[n]],{n,20}]

A355388 Number of composable pairs (y, v) of integer compositions of n, where a composition is regarded as an arrow from the number of parts to the number of distinct parts.

Original entry on oeis.org

1, 1, 2, 6, 18, 58, 174, 536, 1656, 4947, 14800, 43157, 126572, 364070, 1039926, 2938898, 8223400, 22846370, 62930113, 172177400, 467002792, 1259736804, 3371190792, 8973530491, 23728305128, 62421018163, 163255839779, 424842462529, 1100006243934, 2834558927244, 7270915592897
Offset: 0

Views

Author

Gus Wiseman, Jul 02 2022

Keywords

Comments

Being composable here means that the length of v equals the number of distinct parts in y.

Examples

			The a(0) = 1 through a(4) = 18 pairs:
  ()()  (1)(1)  (2)(2)   (3)(3)    (4)(4)
                (11)(2)  (21)(21)  (31)(31)
                         (21)(12)  (31)(13)
                         (12)(21)  (31)(22)
                         (12)(12)  (13)(31)
                         (111)(3)  (13)(13)
                                   (13)(22)
                                   (22)(4)
                                   (211)(31)
                                   (211)(13)
                                   (211)(22)
                                   (121)(31)
                                   (121)(13)
                                   (121)(22)
                                   (112)(31)
                                   (112)(13)
                                   (112)(22)
                                   (1111)(4)
		

Crossrefs

The case with containment is A032020.
The inhomogeneous version with containment is A355384, partitions A355383.
The version for partitions is A355385, with containment A000009.
A133494 counts compositions of each part of a composition, strict A336139.
A323583 counts splittings of partitions.

Programs

  • Maple
    b:= proc(n, i, p) option remember; `if`(n=0, p!, `if`(i<1, 0,
          expand(add(b(n-i*j, i-1, p+j)/j!*`if`(j=0, 1, x), j=0..n/i))))
        end:
    a:= n-> (p-> add(coeff(p, x, i)*binomial(n-1, i-1), i=0..degree(p)))(b(n$2, 0)):
    seq(a(n), n=0..30);  # Alois P. Heinz, Jan 01 2023
  • Mathematica
    Table[Length[Select[Tuples[Join@@Permutations/@IntegerPartitions[n],2], Length[Union[#[[1]]]]==Length[#[[2]]]&]],{n,0,10}]
  • PARI
    a(n) = {if(n==0, 1, my(s=0); forpart(p=n, p=Vec(p); my(S=Set(p)); s += binomial(n-1, #S-1)*(#p)!/prod(i=1, #S, my(c=#select(t->t==S[i], p)); c! )); s)} \\ Andrew Howroyd, Jan 01 2023
    
  • PARI
    \\ for larger n.
    a(n) = { local(Cache=Map());
      my(F(r,m,p,q) = my(key=[r,m,p,q], z); if(!mapisdefined(Cache, key, &z),
      z = if(m==0, if(r==0, p!*binomial(n-1, q-1)), self()(r, m-1, p, q) + sum(j=1, r\m, self()(r-j*m, min(m-1, r-j*m), p+j, q+1)/j!));
      mapput(Cache, key, z) ); z);
      if(n==0, 1, F(n, n, 0, 0))
    } \\ Andrew Howroyd, Jan 01 2023

Formula

a(n) = Sum_{k>=1} binomial(n-1, k-1)*A235998(n, k) for n > 0. - Andrew Howroyd, Jan 01 2023

Extensions

Terms a(14) and beyond from Andrew Howroyd, Jan 01 2023
Showing 1-10 of 16 results. Next