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.

Previous Showing 11-19 of 19 results.

A319856 Maximum number that can be obtained by iteratively adding or multiplying together parts of the integer partition with Heinz number n until only one part remains.

Original entry on oeis.org

0, 1, 2, 2, 3, 3, 4, 3, 4, 4, 5, 4, 6, 5, 6, 4, 7, 6, 8, 6, 8, 6, 9, 6, 9, 7, 8, 8, 10, 9, 11, 6, 10, 8, 12, 9, 12, 9, 12, 9, 13, 12, 14, 10, 12, 10, 15, 9, 16, 12, 14, 12, 16, 12, 15, 12, 16, 11, 17, 12, 18, 12, 16, 9, 18, 15, 19, 14, 18, 16, 20, 12, 21, 13
Offset: 1

Views

Author

Gus Wiseman, Sep 29 2018

Keywords

Comments

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

Examples

			a(30) = 9 because the maximum number that can be obtained starting with (3,2,1) is 3*(2+1) = 9.
		

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

A319841 Number of distinct positive integers that can be obtained by iteratively adding or multiplying together parts of the integer partition with Heinz number n until only one part remains.

Original entry on oeis.org

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

Views

Author

Gus Wiseman, Sep 29 2018

Keywords

Examples

			60 is the Heinz number of (3,2,1,1) and
   5 = (3+2)*1*1
   6 = 3*2*1*1
   7 = 3+2+1+1
   8 = (3+1)*2*1
   9 = 3*(2+1)*1
  10 = (3+2)*(1+1)
  12 = (3+1)*(2+1)
so we have a(60) = 7. It is not possible to obtain 11 by adding or multiplying together the parts of (3,2,1,1).
		

Crossrefs

Programs

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

Formula

a(2^n) = A048249(n).

A370817 Greatest number of multisets that can be obtained by choosing a prime factor of each factor in an integer factorization of n into unordered factors > 1.

Original entry on oeis.org

1, 1, 1, 1, 1, 2, 1, 1, 1, 2, 1, 2, 1, 2, 2, 1, 1, 2, 1, 2, 2, 2, 1, 2, 1, 2, 1, 2, 1, 3, 1, 1, 2, 2, 2, 3, 1, 2, 2, 2, 1, 3, 1, 2, 2, 2, 1, 2, 1, 2, 2, 2, 1, 2, 2, 2, 2, 2, 1, 4, 1, 2, 2, 1, 2, 3, 1, 2, 2, 3, 1, 3, 1, 2, 2, 2, 2, 3, 1, 2, 1, 2, 1, 4, 2, 2, 2
Offset: 1

Views

Author

Gus Wiseman, Mar 07 2024

Keywords

Comments

First differs from A096825 at a(210) = 4, A096825(210) = 6.
First differs from A343943 at a(210) = 4, A343943(210) = 6.
First differs from A345926 at a(90) = 4, A345926(90) = 3.

Examples

			For the factorizations of 60 we have the following choices (using prime indices {1,2,3} instead of prime factors {2,3,5}):
  (2*2*3*5): {{1,1,2,3}}
   (2*2*15): {{1,1,2},{1,1,3}}
   (2*3*10): {{1,1,2},{1,2,3}}
    (2*5*6): {{1,1,3},{1,2,3}}
    (3*4*5): {{1,2,3}}
     (2*30): {{1,1},{1,2},{1,3}}
     (3*20): {{1,2},{2,3}}
     (4*15): {{1,2},{1,3}}
     (5*12): {{1,3},{2,3}}
     (6*10): {{1,1},{1,2},{1,3},{2,3}}
       (60): {{1},{2},{3}}
So a(60) = 4.
		

Crossrefs

For all divisors (not just prime factors) we have A370816.
The version for partitions is A370809, for all divisors A370808.
A000005 counts divisors.
A001055 counts factorizations, strict A045778.
A006530 gives greatest prime factor, least A020639.
A027746 lists prime factors, A112798 indices, length A001222.
A355741 chooses prime factors of prime indices, variations A355744, A355745.
A368413 counts non-choosable factorizations, complement A368414.
A370813 counts non-divisor-choosable factorizations, complement A370814.

Programs

  • Mathematica
    facs[n_]:=If[n<=1,{{}},Join@@Table[Map[Prepend[#,d]&,Select[facs[n/d],Min@@#>=d&]],{d,Rest[Divisors[n]]}]];
    Table[Max[Length[Union[Sort/@Tuples[If[#==1,{},First/@FactorInteger[#]]&/@#]]]&/@facs[n]],{n,100}]

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

A069765 Number of distinct values obtained using n ones and the operations of sum, product and quotient.

Original entry on oeis.org

1, 2, 4, 7, 13, 24, 42, 77, 138, 249, 454, 823, 1493, 2719, 4969, 9060, 16588, 30375, 55672, 102330, 188334, 346624, 639280, 1179742, 2178907, 4029060, 7456271, 13806301, 25587417, 47452133, 88057540, 163518793, 303826088, 564825654
Offset: 1

Views

Author

John W. Layman, Apr 05 2002

Keywords

Examples

			a(5)=13 because five ones yield the following 13 distinct values and no others: 1+1+1+1+1=5, 1+1+1+(1/1)=4, 1/(1+1+1+1)=1/4, 1+(1/1)+(1/1)=3, 1/(1+1+(1/1))=1/3, 1+(1/(1+1+1))=4/3, 1+(1/1)*(1/1)=2, 1/((1/1)+(1/1))=1/2, (1+1+1)/(1+1)=3/2, 1+1+(1/(1+1))=5/2, (1+1)/(1+1+1)=2/3, 1*1*1*1*1=1 and (1+1)*(1+1+1)=6.
		

Crossrefs

Cf. A048249.

Programs

  • Python
    from fractions import Fraction
    from functools import lru_cache
    @lru_cache()
    def f(m):
        if m == 1: return {Fraction(1, 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])
                    if y: out.add(Fraction(x, y))
                    if x: out.add(Fraction(y, x))
        return out
    def a(n): return len(f(n))
    print([a(n) for n in range(1, 16)]) # Michael S. Branicky, Jul 28 2022

Extensions

a(20)-a(30) from Michael S. Branicky, Jul 29 2022
a(31)-a(34) from Michael S. Branicky, Jun 30 2023

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).

A307900 Number of functions constructed from n instances of variable x using operators + (add), * (multiply), and parentheses.

Original entry on oeis.org

1, 2, 4, 10, 24, 61, 150, 382, 964, 2452, 6307, 16379, 42989, 113965, 305035, 823632, 2241814, 6145670, 16956972, 47059076, 131279567
Offset: 1

Views

Author

Vladimir Reshetnikov, May 04 2019

Keywords

Comments

Structurally different expressions that represent the same function of x are only counted once. So, a(n) <= A052701(n).

Examples

			For n = 1, we have only one function {x}, so a(1) = 1.
For n = 2, we have {x*x, x + x} = {x^2, 2*x}, so a(2) = 2.
For n = 3, we have {x^2*x, 2*x*x, x^2 + x, 2*x + x} = {x^3, 2*x^2, x^2 + x, 3*x}, so a(3) = 4.
For n = 4, we have {x^4, 2*x^3, x^3 + x^2, x^3 + x, 4*x^2, 3*x^2, 2*x^2 + x, 2*x^2, x^2 + 2*x, 4*x}, so a(4) = 10.
		

Crossrefs

Programs

  • Maple
    b:= proc(n) option remember; `if`(n=1, {x}, {seq(seq(seq([f+g,
            expand(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..12);  # Alois P. Heinz, May 04 2019
  • Mathematica
    ClearAll[a, f, x, n, k]; f[1] = {x}; f[n_Integer] := f[n] = DeleteDuplicates[Expand[Flatten[Table[Outer[#1[#2, #3] &, {Times, Plus}, f[k], f[n - k]], {k, n/2}]]]]; a[n_Integer] := Length[f[n]]; Table[a[n], {n, 15}]

Extensions

a(19)-a(20) from Alois P. Heinz, May 04 2019
a(21) from Vladimir Reshetnikov, May 05 2019

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}]
Previous Showing 11-19 of 19 results.