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

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

A319910 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 or multiplying together parts of y until only one part (equal to m) remains.

Original entry on oeis.org

1, 3, 6, 11, 23, 48, 85, 178, 331, 619, 1176, 2183, 3876, 7013, 12447, 21719, 37628, 64570, 109723, 185055
Offset: 1

Views

Author

Gus Wiseman, Oct 01 2018

Keywords

Examples

			The a(4) = 11 pairs:
  4 <= (4)
  3 <= (3,1)
  4 <= (3,1)
  4 <= (2,2)
  2 <= (2,1,1)
  3 <= (2,1,1)
  4 <= (2,1,1)
  1 <= (1,1,1,1)
  2 <= (1,1,1,1)
  3 <= (1,1,1,1)
  4 <= (1,1,1,1)
		

Crossrefs

Programs

  • Mathematica
    ReplaceListRepeated[forms_,rerules_]:=Union[Flatten[FixedPointList[Function[pre,Union[Flatten[ReplaceList[#,rerules]&/@pre,1]]],forms],1]];
    nexos[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_,mie___,y_,afe___}:>Sort[Append[{foe,mie,afe},x*y]]}],Length[#]==1&]];
    Table[Total[Length/@nexos/@IntegerPartitions[n]],{n,20}]

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

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

A319911 Number of distinct pairs (m, y), where m >= 1 and y is an integer partition of n with no 1's, such that m can be obtained by iteratively adding or multiplying together parts of y until only one part (equal to m) remains.

Original entry on oeis.org

0, 1, 1, 2, 3, 7, 9, 21, 31, 65, 102, 194, 321, 575, 956, 1652, 2684, 4576, 7367, 12035, 19490, 31185, 49418, 78595, 123393
Offset: 1

Views

Author

Gus Wiseman, Oct 01 2018

Keywords

Examples

			The a(6) = 7 pairs:
  6 <= (6)
  6 <= (4,2)
  8 <= (4,2)
  6 <= (3,3)
  9 <= (3,3)
  6 <= (2,2,2)
  8 <= (2,2,2)
The a(7) = 9 pairs:
   7 <= (7)
   7 <= (5,2)
  10 <= (5,2)
   7 <= (4,3)
  12 <= (4,3)
   7 <= (3,2,2)
   8 <= (3,2,2)
  10 <= (3,2,2)
  12 <= (3,2,2)
		

Crossrefs

Programs

  • Mathematica
    ReplaceListRepeated[forms_,rerules_]:=Union[Flatten[FixedPointList[Function[pre,Union[Flatten[ReplaceList[#,rerules]&/@pre,1]]],forms],1]];
    nexos[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_,mie___,y_,afe___}:>Sort[Append[{foe,mie,afe},x*y]]}],Length[#]==1&]];
    Table[Total[Length/@nexos/@Select[IntegerPartitions[n],FreeQ[#,1]&]],{n,30}]

A319925 Number of integer partitions with no 1's whose parts can be combined together using additions and multiplications to obtain n.

Original entry on oeis.org

0, 1, 1, 2, 2, 5, 4, 10, 10, 18, 19, 38, 35, 62, 71, 113, 122, 199, 213, 329
Offset: 1

Views

Author

Gus Wiseman, Oct 01 2018

Keywords

Comments

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

Examples

			The a(8) = 10 partitions (which are not all partitions of 8):
  (8),
  (42), (62), (53), (44),
  (222), (322), (422), (332),
  (2222).
For example, this list contains (322) because we can write 8 = 3*2+2.
		

Crossrefs

Formula

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

A319907 Number of distinct integers that can be obtained by iteratively adding any two or multiplying any two non-1 parts of an integer partition until only one part remains, starting with the integer partition with Heinz number n.

Original entry on oeis.org

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

Views

Author

Gus Wiseman, Oct 01 2018

Keywords

Comments

The Heinz number of an integer partition (y_1, ..., y_k) is prime(y_1) * ... * prime(y_k).

Examples

			The Heinz number of (3,3,2) is 75 and we have
    3+3+2 = 8,
    3+3*2 = 9,
    3*3+2 = 11,
  (3+3)*2 = 12,
  3*(3+2) = 15,
    3*3*2 = 18,
so a(75) = 6.
		

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[Length[mexos[If[n==1,{},Flatten[Cases[FactorInteger[n],{p_,k_}:>Table[PrimePi[p],{k}]]]]]],{n,100}]

A357858 Number of integer partitions that can be obtained by iteratively adding and multiplying together parts of the integer partition with Heinz number n.

Original entry on oeis.org

1, 1, 1, 3, 1, 3, 1, 6, 2, 3, 1, 7, 1, 3, 3, 11, 1, 7, 1, 8, 3, 3, 1, 14, 3, 3, 4, 8, 1, 11, 1, 19, 3, 3, 3, 18, 1, 3, 3, 18, 1, 12, 1, 8, 8, 3, 1, 27, 3, 10, 3, 8, 1, 16, 3, 19, 3, 3, 1, 25, 1, 3, 8, 33, 3, 12, 1, 8, 3, 12, 1, 35, 1, 3, 11, 8, 3, 12, 1, 34, 9
Offset: 1

Views

Author

Gus Wiseman, Oct 17 2022

Keywords

Comments

The Heinz number of a partition (y_1,...,y_k) is prime(y_1)*...*prime(y_k). This gives a bijective correspondence between positive integers and integer partitions.

Examples

			The a(n) partitions for n = 1, 4, 8, 9, 12, 16, 20, 24:
  ()  (1)   (1)    (4)   (2)    (1)     (3)    (2)
      (2)   (2)    (22)  (3)    (2)     (4)    (3)
      (11)  (3)          (4)    (3)     (5)    (4)
            (11)         (21)   (4)     (6)    (5)
            (21)         (22)   (11)    (31)   (6)
            (111)        (31)   (21)    (32)   (21)
                         (211)  (22)    (41)   (22)
                                (31)    (311)  (31)
                                (111)          (32)
                                (211)          (41)
                                (1111)         (211)
                                               (221)
                                               (311)
                                               (2111)
		

Crossrefs

The single-part partitions are counted by A319841, with an inverse A319913.
The minimum is A319855, maximum A319856.
A000041 counts integer partitions.
A001222 counts prime indices, distinct A001221.
A056239 adds up prime indices.
A066739 counts representations as a sum of products.

Programs

  • Mathematica
    primeMS[n_]:=If[n==1,{},Flatten[Cases[FactorInteger[n],{p_,k_}:>Table[PrimePi[p],{k}]]]];
    ReplaceListRepeated[forms_,rerules_]:=Union[Flatten[FixedPointList[Function[pre,Union[Flatten[ReplaceList[#,rerules]&/@pre,1]]],forms],1]];
    Table[Length[ReplaceListRepeated[{primeMS[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]]}]],{n,100}]
Showing 1-8 of 8 results.