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

A289501 Number of enriched p-trees of weight n.

Original entry on oeis.org

1, 1, 2, 4, 12, 32, 112, 352, 1296, 4448, 16640, 59968, 231168, 856960, 3334400, 12679424, 49991424, 192890880, 767229952, 2998427648, 12015527936, 47438950400, 191117033472, 760625733632, 3082675150848, 12346305839104, 50223511928832, 202359539335168
Offset: 0

Views

Author

Gus Wiseman, Jul 07 2017

Keywords

Comments

An enriched p-tree of weight n is either (case 1) the number n itself, or (case 2) a sequence of two or more enriched p-trees, having a weakly decreasing sequence of weights summing to n.

Examples

			The a(4) = 12 enriched p-trees are:
  4,
  (31), ((21)1), (((11)1)1), ((111)1),
  (22), (2(11)), ((11)2), ((11)(11)),
  (211), ((11)11),
  (1111).
		

Crossrefs

Programs

  • Maple
    b:= proc(n, i) option remember; `if`(n=0, 1,
          `if`(i<1, 0, b(n, i-1)+a(i)*b(n-i, min(n-i, i))))
        end:
    a:= n-> `if`(n=0, 1, 1+b(n, n-1)):
    seq(a(n), n=0..30);  # Alois P. Heinz, Jul 07 2017
  • Mathematica
    a[n_]:=a[n]=1+Sum[Times@@a/@y,{y,Rest[IntegerPartitions[n]]}];
    Array[a,20]
    (* Second program: *)
    b[n_, i_] := b[n, i] = If[n == 0, 1,
         If[i<1, 0, b[n, i-1] + a[i] b[n-i, Min[n-i, i]]]];
    a[n_] := If[n == 0, 1, 1 + b[n, n-1]];
    a /@ Range[0, 30] (* Jean-François Alcover, May 09 2021, after Alois P. Heinz *)
  • PARI
    seq(n)={my(v=vector(n)); for(n=1, n, v[n] = 1 + polcoef(1/prod(k=1, n-1, 1 - v[k]*x^k + O(x*x^n)), n)); concat([1], v)} \\ Andrew Howroyd, Aug 26 2018

Formula

O.g.f.: (1/(1-x) + Product_{i>0} 1/(1-a(i)*x^i))/2.

A299202 Moebius function of the multiorder of integer partitions indexed by their Heinz numbers.

Original entry on oeis.org

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

Views

Author

Gus Wiseman, Feb 05 2018

Keywords

Comments

By convention, mu() = 0.
The Heinz number of an integer partition (y_1,...,y_k) is prime(y_1)*...*prime(y_k).

Examples

			Heinz number of (2,1,1) is 12, so mu(2,1,1) = a(12) = 2.
		

Crossrefs

Programs

  • Mathematica
    nn=120;
    ptns=Table[If[n===1,{},Join@@Cases[FactorInteger[n]//Reverse,{p_,k_}:>Table[PrimePi[p],{k}]]],{n,nn}];
    tris=Join@@Map[Tuples[IntegerPartitions/@#]&,ptns];
    mu[y_]:=mu[y]=If[Length[y]===1,1,-Sum[Times@@mu/@t,{t,Select[tris,And[Length[#]>1,Sort[Join@@#,Greater]===y]&]}]];
    mu/@ptns

Formula

mu(y) = Sum_{g(t)=y} (-1)^d(t), where the sum is over all enriched p-trees (A289501, A299203) whose multiset of leaves is the integer partition y, and d(t) is the number of non-leaf nodes in t.

A299200 Number of twice-partitions whose domain is the integer partition with Heinz number n.

Original entry on oeis.org

1, 1, 2, 1, 3, 2, 5, 1, 4, 3, 7, 2, 11, 5, 6, 1, 15, 4, 22, 3, 10, 7, 30, 2, 9, 11, 8, 5, 42, 6, 56, 1, 14, 15, 15, 4, 77, 22, 22, 3, 101, 10, 135, 7, 12, 30, 176, 2, 25, 9, 30, 11, 231, 8, 21, 5, 44, 42, 297, 6, 385, 56, 20, 1, 33, 14, 490, 15, 60, 15, 627, 4
Offset: 1

Views

Author

Gus Wiseman, Feb 05 2018

Keywords

Comments

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

Examples

			The a(15) = 6 twice-partitions: (3)(2), (3)(11), (21)(2), (21)(11), (111)(2), (111)(11).
		

Crossrefs

Programs

  • Maple
    with(numtheory): with(combinat):
    a:= n-> mul(numbpart(pi(i[1]))^i[2], i=ifactors(n)[2]):
    seq(a(n), n=1..82);  # Alois P. Heinz, Jan 14 2021
  • Mathematica
    Table[Times@@Cases[FactorInteger[n],{p_,k_}:>PartitionsP[PrimePi[p]]^k],{n,100}]
  • PARI
    a(n) = {my(f = factor(n)); for (k=1, #f~, f[k, 1] = numbpart(primepi(f[k, 1]));); factorback(f);} \\ Michel Marcus, Feb 26 2018

Formula

Multiplicative with a(prime(n)) = A000041(n).

A299201 Number of twice-partitions whose composite is the integer partition with Heinz number n.

Original entry on oeis.org

1, 1, 1, 2, 1, 2, 1, 3, 2, 2, 1, 5, 1, 2, 2, 5, 1, 4, 1, 4, 2, 2, 1, 8, 2, 2, 3, 4, 1, 6, 1, 7, 2, 2, 2, 11, 1, 2, 2, 8, 1, 5, 1, 4, 4, 2, 1, 16, 2, 4, 2, 4, 1, 7, 2, 7, 2, 2, 1, 13, 1, 2, 5, 11, 2, 5, 1, 4, 2, 6, 1, 19, 1, 2, 4, 4, 2, 5, 1, 13, 5, 2, 1, 13, 2
Offset: 1

Views

Author

Gus Wiseman, Feb 05 2018

Keywords

Comments

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

Examples

			The a(36) = 11 twice-partitions:
  (2211),
  (22)(11), (211)(2), (221)(1), (21)(21),
  (2)(2)(11), (2)(11)(2), (11)(2)(2), (22)(1)(1), (21)(2)(1),
  (2)(2)(1)(1).
		

Crossrefs

Programs

  • Mathematica
    nn=100;
    ptns=Table[If[n===1,{},Join@@Cases[FactorInteger[n]//Reverse,{p_,k_}:>Table[PrimePi[p],{k}]]],{n,nn}];
    tris=Join@@Map[Tuples[IntegerPartitions/@#]&,ptns];
    Table[Length[Select[tris,Sort[Join@@#,Greater]===y&]],{y,ptns}]

A289078 Number of orderless same-trees of weight n.

Original entry on oeis.org

1, 2, 2, 5, 2, 9, 2, 22, 6, 11, 2, 94, 2, 13, 12, 334, 2, 205, 2, 210, 14, 17, 2, 7218, 8, 19, 68, 443, 2, 1687, 2, 69109, 18, 23, 16, 167873, 2, 25, 20, 89969, 2, 7041, 2, 1548, 644, 29, 2, 36094795, 10, 3078, 24, 2604, 2, 1484102, 20, 1287306, 26, 35, 2
Offset: 1

Views

Author

Gus Wiseman, Jun 23 2017

Keywords

Comments

An orderless same-tree t is either: (case 1) a positive integer, or (case 2) a finite multiset of two or more orderless same-trees, all having the same weight. The weight of t in case 1 is the number itself, and in case 2 it is the sum of weights of the branches. For example {{{3,{1,1,1}},{2,{1,1},{1,1}}},{{{1,1,1},{1,1,1}},{{1,1},{1,1},{1,1}}}} is an orderless same-tree of weight 24 with 2 branches.

Examples

			The a(6)=9 orderless same-trees are: 6, (33), (3(111)), (222), (22(11)), (2(11)(11)), ((11)(11)(11)), ((111)(111)), (111111).
		

Crossrefs

Programs

  • Maple
    with(numtheory):
    a:= proc(n) option remember; 1 + add(
          binomial(a(n/d)+d-1, d), d=divisors(n) minus {1})
        end:
    seq(a(n), n=1..60);  # Alois P. Heinz, Jul 05 2017
  • Mathematica
    a[n_]:=If[n===1,1,1+Sum[Binomial[a[n/d]+d-1,d],{d,Rest[Divisors[n]]}]];
    Array[a,100]
  • PARI
    seq(n)={my(v=vector(n)); for(n=1, n, v[n] = 1 + sumdiv(n, d, binomial(v[n/d]+d-1, d))); v} \\ Andrew Howroyd, Aug 20 2018

Formula

a(n) = 1 + Sum_{d|n, d>1} binomial(a(n/d)+d-1, d).

A289079 Number of orderless same-trees of weight n with all leaves equal to 1.

Original entry on oeis.org

1, 1, 1, 2, 1, 3, 1, 5, 2, 3, 1, 13, 1, 3, 3, 22, 1, 16, 1, 15, 3, 3, 1, 151, 2, 3, 6, 17, 1, 41, 1, 334, 3, 3, 3, 637, 1, 3, 3, 275, 1, 56, 1, 21, 19, 3, 1, 15591, 2, 27, 3, 23, 1, 902, 3, 516, 3, 3, 1, 7858, 1, 3, 21, 69109, 3, 98, 1, 27, 3, 67, 1, 811756, 1
Offset: 1

Views

Author

Gus Wiseman, Jun 23 2017

Keywords

Comments

a(n) is also the number of orderless same-trees of weight n with all leaves greater than 1.

Examples

			The a(12)=13 orderless same-trees with all leaves greater than 1 are: ((33)(33)), ((33)(222)), ((33)6), ((222)(222)), ((222)6), (66), ((22)(22)(22)), ((22)(22)4), ((22)44), (444), (3333), (222222), 12.
		

Crossrefs

Programs

  • Maple
    with(numtheory):
    a:= proc(n) option remember; `if`(n=1, 1, add(
          binomial(a(n/d)+d-1, d), d=divisors(n) minus {1}))
        end:
    seq(a(n), n=1..80);  # Alois P. Heinz, Jul 05 2017
  • Mathematica
    a[n_]:=If[n===1,1,Sum[Binomial[a[n/d]+d-1,d],{d,Rest[Divisors[n]]}]];
    Array[a,100]
  • PARI
    seq(n)={my(v=vector(n)); v[1]=1; for(n=2, n, v[n] = sumdiv(n, d, binomial(v[n/d]+d-1, d))); v} \\ Andrew Howroyd, Aug 20 2018
    
  • Python
    from sympy import divisors, binomial
    l=[0, 1]
    for n in range(2, 101): l+=[sum([binomial(l[n//d] + d - 1, d) for d in divisors(n)[1:]]), ]
    l[1:] # Indranil Ghosh, Jul 06 2017

Formula

a(1) = 1, a(n>1) = Sum_{d|n, d>1} binomial(a(n/d)+d-1, d).

A299203 Number of enriched p-trees whose multiset of leaves is the integer partition with Heinz number n.

Original entry on oeis.org

0, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 4, 1, 1, 1, 5, 1, 3, 1, 3, 1, 1, 1, 11, 1, 1, 2, 3, 1, 5, 1, 12, 1, 1, 1, 15, 1, 1, 1, 11, 1, 4, 1, 3, 3, 1, 1, 38, 1, 3, 1, 3, 1, 9, 1, 9, 1, 1, 1, 21, 1, 1, 4, 34, 1, 4, 1, 3, 1, 5, 1, 54, 1, 1, 3, 3, 1, 4, 1, 33, 5, 1, 1, 23, 1, 1, 1, 9, 1, 20, 1, 3, 1, 1, 1, 117, 1, 3, 3, 12, 1, 4, 1, 9, 4, 1, 1, 57, 1, 4, 1, 34
Offset: 1

Views

Author

Gus Wiseman, Feb 05 2018

Keywords

Comments

By convention, a(1) = 0.
The Heinz number of an integer partition (y_1,...,y_k) is prime(y_1)*...*prime(y_k).

Examples

			a(54) = 9: (((22)2)1), ((222)1), (((22)1)2), (((21)2)2), ((221)2), ((22)(21)), ((22)21), ((21)22), (2221).
a(40) = 11: ((31)(11)), (((31)1)1), ((3(11))1), ((311)1), (3((11)1)), (3(111)), (((11)1)3), ((111)3), ((31)11), (3(11)1), (3111).
a(36) = 15: ((22)(11)), ((2(11))2), (((11)2)2), (((21)1)2), ((211)2), (((22)1)1), (((21)2)1), ((221)1), ((21)(21)), (22(11)), (2(11)2), ((11)22), ((22)11), ((21)21), (2211).
		

Crossrefs

Programs

  • Mathematica
    nn=120;
    ptns=Table[If[n===1,{},Join@@Cases[FactorInteger[n]//Reverse,{p_,k_}:>Table[PrimePi[p],{k}]]],{n,nn}];
    tris=Join@@Map[Tuples[IntegerPartitions/@#]&,ptns];
    qci[y_]:=qci[y]=If[Length[y]===1,1,Sum[Times@@qci/@t,{t,Select[tris,And[Length[#]>1,Sort[Join@@#,Greater]===y]&]}]];
    qci/@ptns

A006241 Number of minimal plane trees with n terminal nodes.

Original entry on oeis.org

1, 1, 1, 2, 1, 3, 1, 6, 2, 3, 1, 20, 1, 3, 3, 54, 1, 34, 1, 44, 3, 3, 1, 764, 2, 3, 10, 140, 1, 283, 1, 4470, 3, 3, 3, 10416, 1, 3, 3, 10820, 1, 2227, 1, 2060, 62, 3, 1, 958476, 2, 250, 3, 8204, 1, 59154, 3, 316004, 3, 3, 1, 3457904, 1, 3, 158, 30229110, 3
Offset: 1

Views

Author

Keywords

Comments

In equation (4.4) Lew says a(p^3) = 3+3^p, but this is incorrect, it should be a(p^3) = 2+2^p. - Sean A. Irvine, Feb 07 2017
From Gus Wiseman, Jan 15 2017: (Start)
Number of same-trees of weight n with all leaves equal to 1. A same-tree is either: (case 1) a positive integer, or (case 2) a finite sequence of two or more same-trees all having the same weight, where the weight in case 2 is the sum of weights.
For n>1, a(n) is also equal to the number of same-trees of weight n with all leaves greater than 1 (see example). (End)

Examples

			The a(12)=20 same-trees with all leaves greater than 1 are:
12, (3333), (222222), ((33)(33)), ((33)(222)), ((33)6), ((222)(33)), ((222)(222)), ((222)6), (6(33)), (6(222)), (66), ((22)(22)(22)), ((22)(22)4), ((22)4(22)), ((22)44), (4(22)(22)), (4(22)4), (44(22)), (444). - _Gus Wiseman_, Jan 15 2017
		

References

  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Programs

  • Maple
    a:= proc(n) option remember; `if`(n=1, 1, add(
          a(n/d)^d, d=numtheory[divisors](n) minus {1}))
        end:
    seq(a(n), n=1..70);  # Alois P. Heinz, Feb 21 2017
  • Mathematica
    Array[If[#1===1,1,Sum[#0[#1/d]^d,{d,Rest[Divisors[#1]]}]]&,200] (* Gus Wiseman, Jan 15 2017 *)

Formula

a(1)=a(2)=a(3)=a(5)=a(7)=1, a(4)=2, a(6)=3, a(n) = Sum_{1 != d | n} a(n / d)^d [From Lew]. - Sean A. Irvine, Feb 07 2017 [typo corrected by Ilya Gutkovskiy, Apr 24 2019]

Extensions

a(8), a(27), and a(50) corrected by Sean A. Irvine, Feb 07 2017

A301364 Regular triangle where T(n,k) is the number of enriched p-trees of weight n with k leaves.

Original entry on oeis.org

1, 1, 1, 1, 1, 2, 1, 2, 4, 5, 1, 2, 6, 11, 12, 1, 3, 10, 26, 38, 34, 1, 3, 13, 39, 87, 117, 92, 1, 4, 19, 69, 181, 339, 406, 277, 1, 4, 23, 95, 303, 707, 1198, 1311, 806, 1, 5, 30, 143, 514, 1430, 2970, 4525, 4522, 2500, 1, 5, 35, 184, 762, 2446, 6124, 11627
Offset: 1

Views

Author

Gus Wiseman, Mar 19 2018

Keywords

Comments

An enriched p-tree of weight n > 0 is either a single node of weight n, or a finite sequence of two or more enriched p-trees with weakly decreasing weights summing to n.

Examples

			Triangle begins:
  1
  1   1
  1   1   2
  1   2   4   5
  1   2   6  11  12
  1   3  10  26  38  34
  1   3  13  39  87 117  92
  1   4  19  69 181 339 406 277
  ...
The T(5,4) = 11 enriched p-trees: (((21)1)1), ((2(11))1), (((11)2)1), ((211)1), ((21)(11)), (((11)1)2), ((111)2), ((21)11), (2(11)1), ((11)21), (2111).
		

Crossrefs

Programs

  • Mathematica
    eptrees[n_]:=Prepend[Join@@Table[Tuples[eptrees/@ptn],{ptn,Select[IntegerPartitions[n],Length[#]>1&]}],n];
    Table[Length[Select[eptrees[n],Count[#,_Integer,{-1}]===k&]],{n,8},{k,n}]
  • PARI
    A(n)={my(v=vector(n)); for(n=1, n, v[n] = y + polcoef(1/prod(k=1, n-1, 1 - v[k]*x^k + O(x*x^n)), n)); apply(p->Vecrev(p/y), v)}
    { my(T=A(10)); for(n=1, #T, print(T[n])) } \\ Andrew Howroyd, Aug 26 2018

A358905 Number of sequences of integer partitions with total sum n that are rectangular, meaning all lengths are equal.

Original entry on oeis.org

1, 1, 3, 6, 13, 24, 49, 91, 179, 341, 664, 1280, 2503, 4872, 9557, 18750, 36927, 72800, 143880, 284660, 564093, 1118911, 2221834, 4415417, 8781591, 17476099, 34799199, 69327512, 138176461, 275503854, 549502119, 1096327380, 2187894634, 4367310138, 8719509111
Offset: 0

Views

Author

Gus Wiseman, Dec 07 2022

Keywords

Examples

			The a(0) = 1 through a(4) = 13 sequences:
  ()  ((1))  ((2))     ((3))        ((4))
             ((11))    ((21))       ((22))
             ((1)(1))  ((111))      ((31))
                       ((1)(2))     ((211))
                       ((2)(1))     ((1111))
                       ((1)(1)(1))  ((1)(3))
                                    ((2)(2))
                                    ((3)(1))
                                    ((11)(11))
                                    ((1)(1)(2))
                                    ((1)(2)(1))
                                    ((2)(1)(1))
                                    ((1)(1)(1)(1))
		

Crossrefs

The case of set partitions is A038041.
The version for weakly decreasing lengths is A141199, strictly A358836.
For equal sums instead of lengths we have A279787.
The case of twice-partitions is A306319, distinct A358830.
The unordered version is A319066.
The case of plane partitions is A323429.
The case of constant sums also is A358833.
A055887 counts sequences of partitions with total sum n.
A281145 counts same-trees.
A319169 counts partitions with constant Omega, ranked by A320324.
A358911 counts compositions with constant Omega, distinct A358912.

Programs

  • Mathematica
    ptnseq[n_]:=Join@@Table[Tuples[IntegerPartitions/@comp],{comp,Join@@Permutations/@IntegerPartitions[n]}];
    Table[Length[Select[ptnseq[n],SameQ@@Length/@#&]],{n,0,10}]
  • PARI
    P(n,y) = {1/prod(k=1, n, 1 - y*x^k + O(x*x^n))}
    seq(n) = {my(g=P(n,y)); Vec(1 + sum(k=1, n, 1/(1 - polcoef(g, k, y)) - 1))} \\ Andrew Howroyd, Dec 31 2022

Formula

G.f.: 1 + Sum_{k>=1} (1/(1 - [y^k]P(x,y)) - 1) where P(x,y) = 1/Product_{k>=1} (1 - y*x^k). - Andrew Howroyd, Dec 31 2022

Extensions

Terms a(16) and beyond from Andrew Howroyd, Dec 31 2022
Showing 1-10 of 33 results. Next