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.

A014301 Number of internal nodes of even outdegree in all ordered rooted trees with n edges.

Original entry on oeis.org

0, 1, 3, 11, 40, 148, 553, 2083, 7896, 30086, 115126, 442118, 1703052, 6577474, 25461493, 98759971, 383751472, 1493506534, 5820778858, 22714926826, 88745372992, 347087585824, 1358789148058, 5324148664846, 20878676356240, 81937643449468, 321786401450268
Offset: 1

Views

Author

Keywords

Comments

Number of protected vertices in all ordered rooted trees with n edges. A protected vertex in an ordered tree is a vertex at least 2 edges away from its leaf descendants. - Emeric Deutsch, Aug 20 2008
1,3,11,... gives the diagonal sums of A111418. Hankel transform of a(n) is A128834. Hankel transform of a(n+1) is A187340. - Paul Barry, Mar 08 2011
a(n) = A035317(2*n-1,n-1) for n > 0. - Reinhard Zumkeller, Jul 19 2012
Apparently the number of peaks in all Dyck paths of semilength n+1 that are the same height as the preceding peak. - David Scambler, Apr 22 2013
Define an infinite triangle by T(n,0)=A001045(n) (the first column) and T(r,c) = Sum_{k=c-1..r} T(k,c-1) (the sum of all the terms in the preceding column down to row r). Then T(n,n)=a(n+1). The triangle is 0; 1,1; 1,2,3; 3,5,8,11; 5,10,18,29,40; 11,21,39,68,108,148;... Example: T(5,2)=39=the sum of the terms in column 1 from T(1,1) to T(5,1), namely, 1+2+5+10+21. - J. M. Bergot, May 17 2013
Also for n>=1 the number of unimodal functions f:[n]->[n] with f(1)<>1 and f(i)<>f(i+1). a(4) = 11: [2,3,2,1], [2,3,4,1], [2,3,4,2], [2,3,4,3], [2,4,2,1], [2,4,3,1], [2,4,3,2], [3,4,2,1], [3,4,3,1], [3,4,3,2], [4,3,2,1]. - Alois P. Heinz, May 23 2013

Crossrefs

Programs

  • Magma
    [(1/2)*(&+[(-1)^(n-k)*Binomial(n+k-1,k): k in [0..n]]): n in [1..30]]; // G. C. Greubel, Jan 15 2018
    
  • Mathematica
    Rest[CoefficientList[Series[(1-2*x-Sqrt[1-4*x])/(3*Sqrt[1-4*x]-1+4*x), {x, 0, 50}], x]] (* G. C. Greubel, Jan 15 2018 *)
  • PARI
    x='x+O('x^30); Vec((1-2*x-sqrt(1-4*x))/(3*sqrt(1-4*x)-1+4*x)) \\ G. C. Greubel, Jan 15 2018
    
  • Python
    from itertools import count, islice
    def A014301_gen(): # generator of terms
        yield from (0,1)
        a, b, c = 0, 3, 1
        for n in count(1):
            yield ((b:=b*((n<<1)+3<<1)//(n+2))-(a:=(c:=c*((n<<2)+2)//(n+2))-a>>1))//3
    A014301_list = list(islice(A014301_gen(),20)) # Chai Wah Wu, Apr 27 2023

Formula

a(n) = binomial(2*n-1, n)/3 - A000957(n)/3;
a(n) = (1/2)*Sum_{k=0..n} (-1)^(n-k)*binomial(n+k-1, k). - Vladeta Jovovic, Aug 28 2002
From Emeric Deutsch, Jan 26 2004: (Start)
G.f.: (1-2*z-sqrt(1-4*z))/(3*sqrt(1-4*z)-1+4*z).
a(n) = [A026641(n) - A026641(n-1)]/3 for n>1. (End)
a(n) = (1/2)*Sum_{j=0..floor(n/2)} binomial(2n-2j-2, n-2).
a(n) = Sum_{k=0..n} (-1)^(n-k)*C(n+k,k-1). - Paul Barry, Jul 18 2006
D-finite with recurrence: 2*n*a(n) +(-9*n+8)*a(n-1) +(3*n-16)*a(n-2) +2*(2*n-5)*a(n-3)=0. - R. J. Mathar, Dec 03 2012

A046736 Number of ways to place non-intersecting diagonals in convex n-gon so as to create no triangles.

Original entry on oeis.org

1, 0, 1, 1, 4, 8, 25, 64, 191, 540, 1616, 4785, 14512, 44084, 135545, 418609, 1302340, 4070124, 12785859, 40325828, 127689288, 405689020, 1293060464, 4133173256, 13246527139, 42557271268, 137032656700, 442158893833, 1429468244788
Offset: 2

Views

Author

Keywords

Examples

			a(4)=a(5)=1 because of null placement; a(6)=4 because in addition to not placing any, we might also place one between any of the 3 pairs of opposite vertices.
		

Crossrefs

Cf. A001003 (Schroeder), A001006 (Motzkin), A000108 (Catalan), A052524.

Programs

  • Magma
    A046736:= func< n | n eq 2 select 1 else (&+[Binomial(n+k-2,k)*Binomial(n-k-3, k-1)/(n-1): k in [0..Floor(n/2)-1]]) >;
    [A046736(n): n in [2..40]]; // G. C. Greubel, Jul 31 2024
    
  • Maple
    a := n->1/(n-1)*sum(binomial(n+k-2,k)*binomial(n-k-3,k-1),k=0..floor(n/2-1)); seq(a(i),i=2..30);
  • Mathematica
    (* Programs from Jean-François Alcover, Apr 14 2017: Start *)
    (* First program *)
    a[2]=1; a[n_] := Sum[Binomial[n+k-2, k]*Binomial[n-k-3, k-1], {k, 0, Floor[n/2]-1}]/(n-1);
    (* 2nd program: *)
    x*InverseSeries[Series[(y-y^2-y^3)/(1-y), {y, 0, 29}], x]
    (* 3rd program: *)
    a[2]=1; a[3]=0; a[n_] := HypergeometricPFQ[{2-n/2, 5/2-n/2, n}, {2, 4-n}, -4]; Table[a[n], {n, 2, 30}]
    (* End *)
  • PARI
    a(n)=if(n<2,0,polcoeff(serreverse((x-x^2-x^3)/(1-x)+x*O(x^n)),n-1))
    
  • SageMath
    def A046736(n): return 1 if n==2 else sum(binomial(n+k-2,k)*binomial(n-k-3, k-1)//(n-1) for k in range(n//2))
    [A046736(n) for n in range(2,41)] # G. C. Greubel, Jul 31 2024

Formula

G.f.: A(x) = Sum_{n>0} a(n)*x^(n-1) satisfies A(x) - A(x)^2 - A(x)^3 = x*(1 - A(x)).
a(n) = A052524(n-1)/(n-1)!, for n > 0.
Let g = (1-x)/(1-x-x^2) then a(m) = coeff. of x^(m-2) in g^(m-1)/(m-1).
D-finite with recurrence: 5*(n-1)*n*(37*n-95)*a(n) = 4*(n-1)*(74*n^2 -301*n +300)*a(n-1) + 8*(2*n-5)*(74*n^2 -301*n +297)*a(n-2) - 2*(n-3)*(2*n-7)*(37*n-58)*a(n-3). - Vaclav Kotesovec, Aug 10 2013
a(n) = A143363(n-3) + Sum_{k=0..n-6} ( A143363(k+1)*a(n-k-2) ). - Muhammed Sefa Saydam, Feb 14 2025 and Aug 05 2025

A118376 Number of all trees of weight n, where nodes have positive integer weights and the sum of the weights of the children of a node is equal to the weight of the node.

Original entry on oeis.org

1, 2, 6, 24, 112, 568, 3032, 16768, 95200, 551616, 3248704, 19389824, 117021824, 712934784, 4378663296, 27081760768, 168530142720, 1054464293888, 6629484729344, 41860283723776, 265346078982144, 1687918305128448, 10771600724946944, 68941213290561536
Offset: 1

Views

Author

Jeremy Johnson (jjohnson(AT)cs.drexel.edu), May 15 2006

Keywords

Comments

The number of trees with leaf nodes equal to 1 is counted by the sequence A001003 of super-Catalan numbers. The number of binary trees is counted by the sequence A007317 and the number of binary trees with leaf nodes equal to 1 is counted by the sequence A000108 of Catalan numbers.
Also the number of series-reduced enriched plane trees of weight n. A series-reduced enriched plane tree of weight n is either the number n itself or a finite sequence of at least two series-reduced enriched plane trees, one of each part of an integer composition of n. For example, the a(3) = 6 trees are: 3, (21), (12), (111), ((11)1), (1(11)). - Gus Wiseman, Sep 11 2018
Conjectured to be the number of permutations of length n avoiding the partially ordered pattern (POP) {1>2, 1>3, 3>4, 3>5} of length 5. That is, conjectured to be the number of length n permutations having no subsequences of length 5 in which the first element is the largest, and the third element is larger than the fourth and fifth elements. - Sergey Kitaev, Dec 13 2020
This conjecture has been proven. It can be restated as the number of size n permutations avoiding 51423, 51432, 52413, 52431, 53412, 53421, 54312, 54321. There are twelve sets of permutations avoiding eight size five permutations that are known to match this sequence. A further four are conjectured to match this sequence. - Christian Bean, Jul 24 2024

Examples

			T(3) = 6 because there are six trees
  3    3      3     3     3       3
      2 1    2 1   1 2   1 2    1 1 1
            1 1           1 1
From _Gus Wiseman_, Sep 11 2018: (Start)
The a(4) = 24 series-reduced enriched plane trees:
  4,
  (31), (13), (22), (211), (121), (112), (1111),
  ((21)1), ((12)1), (1(21)), (1(12)), (2(11)), ((11)2),
  ((111)1), (1(111)), ((11)(11)), ((11)11), (1(11)1), (11(11)),
  (((11)1)1), ((1(11))1), (1((11)1)), (1(1(11))).
(End)
		

Crossrefs

Programs

  • Maple
    T := proc(n) option remember; local C, s, p, tp, k, i; if n = 1 then return 1; else s := 1; for k from 2 to n do C := combinat[composition](n,k); for p in C do tp := map(T,p); s := s + mul(tp[i],i=1..nops(tp)); end do; end do; end if; return s; end;
  • Mathematica
    Rest[CoefficientList[Series[(Sqrt[1-8*x+8*x^2]-1)/(4*x-4), {x, 0, 20}], x]] (* Vaclav Kotesovec, Feb 03 2014 *)
    a[n_] := 1+Sum[Binomial[n-1, k-1]*Hypergeometric2F1[2-k, k+1, 2, -1], {k, 2, n}]; Table[a[n], {n, 1, 20}] (* Jean-François Alcover, Apr 03 2015, after Vladimir Kruchinin *)
    urp[n_]:=Prepend[Join@@Table[Tuples[urp/@ptn],{ptn,Join@@Permutations/@Select[IntegerPartitions[n],Length[#]>1&]}],n];
    Table[Length[urp[n]],{n,7}] (* Gus Wiseman, Sep 11 2018 *)
  • Maxima
    a(n):=sum((-1)^j*2^(n-j-1)*binomial(n,j)*binomial(2*n-2*j-2,n-2*j-1),j,0,(n-1)/2)/n; /* Vladimir Kruchinin, Sep 29 2020 */
  • PARI
    x='x+O('x^25); Vec((sqrt(1-8*x+8*x^2) - 1)/(4*x-4)) \\ G. C. Greubel, Feb 08 2017
    

Formula

Recurrence: T(1) = 1; For n > 1, T(n) = 1 + Sum_{n=n1+...+nt} T(n1)*...*T(nt).
G.f.: (-1+(1-8*z+8*z^2)^(1/2))/(-4+4*z).
From Vladimir Kruchinin, Sep 03 2010: (Start)
O.g.f.: A(x) = A001003(x/(1-x)).
a(n) = Sum_{k=1..n} binomial(n-1,k-1)*A001003(k), n>0. (End)
D-finite with recurrence: n*a(n) + 3*(-3*n+4)*a(n-1) + 4*(4*n-9)*a(n-2) + 8*(-n+3)*a(n-3) = 0. - R. J. Mathar, Sep 27 2013
a(n) ~ sqrt(sqrt(2)-1) * 2^(n-1/2) * (2+sqrt(2))^(n-1) / (sqrt(Pi) * n^(3/2)). - Vaclav Kotesovec, Feb 03 2014
From Peter Bala, Jun 17 2015: (Start)
With offset 0, binomial transform of A001003.
O.g.f. A(x) = series reversion of x*(2*x - 1)/(2*x^2 - 1); 2*(1 - x)*A^2(x) - A(x) + x = 0.
A(x) satisfies the differential equation (x - 9*x^2 + 16*x^3 - 8*x^4)*A'(x) + x*(3 - 4*x)*A(x) + x*(2*x - 1) = 0. Extracting coefficients gives Mathar's recurrence above. (End)
a(n) = Sum_{j=0..(n-1)/2} (-1)^j*2^(n-j-1)*C(n,j)*C(2*n-2*j-2,n-2*j-1)/n. - Vladimir Kruchinin, Sep 29 2020

A319379 Number of plane trees with n nodes where the sequence of branches directly under any given node is a chain of multisets.

Original entry on oeis.org

1, 1, 2, 4, 9, 19, 43, 93, 207, 452, 997, 2176, 4776, 10418, 22781, 49674, 108421
Offset: 1

Views

Author

Gus Wiseman, Sep 17 2018

Keywords

Examples

			The a(6) = 19 chain trees:
  (((((o)))))  ((((oo))))  (((ooo)))  ((oooo))  (ooooo)
               (((o)(o)))  ((o)(oo))  (o(ooo))
               (((o(o))))  ((o(oo)))  (oo(oo))
               ((o((o))))  ((oo(o)))  (ooo(o))
               (o(((o))))  (o((oo)))
                           (o(o)(o))
                           (o(o(o)))
                           (oo((o)))
		

Crossrefs

Programs

  • Mathematica
    submultisetQ[M_,N_]:=Or[Length[M]==0,MatchQ[{Sort[List@@M],Sort[List@@N]},{{x_,Z___},{_,x_,W___}}/;submultisetQ[{Z},{W}]]];
    chnplane[n_]:=If[n==1,{{}},Join@@Table[Select[Tuples[chnplane/@c],And@@submultisetQ@@@Partition[#,2,1]&],{c,Join@@Permutations/@IntegerPartitions[n-1]}]];
    Table[Length[chnplane[n]],{n,10}]

A319378 Number of plane trees with n nodes where the sequence of branches directly under any given node with at least two branches has empty intersection.

Original entry on oeis.org

1, 1, 2, 5, 13, 39, 118, 375, 1225, 4079, 13794, 47287, 163962, 573717, 2023800
Offset: 1

Views

Author

Gus Wiseman, Sep 17 2018

Keywords

Examples

			The a(5) = 13 locally nonintersecting plane trees:
  ((((o))))  (((oo)))  ((ooo))  (oooo)
             (((o)o))  ((oo)o)
             ((o(o)))  (o(oo))
             (((o))o)  ((o)oo)
             (o((o)))  (o(o)o)
                       (oo(o))
		

Crossrefs

Programs

  • Mathematica
    monplane[n_]:=If[n==1,{{}},Join@@Table[Select[Tuples[monplane/@c],Or[Length[#]==1,Intersection@@#=={}]&],{c,Join@@Permutations/@IntegerPartitions[n-1]}]];
    Table[Length[monplane[n]],{n,10}]

A049125 Revert transform of (1 + x - x^2) / (1 + x)^2.

Original entry on oeis.org

1, 1, 2, 4, 10, 25, 68, 187, 534, 1544, 4554, 13576, 40968, 124681, 382636, 1182116, 3674674, 11483243, 36057516, 113701968, 359927638, 1143327888, 3643379152, 11643793399, 37311200060, 119852247220, 385864664018, 1244896820476
Offset: 1

Views

Author

Keywords

Comments

a(n) is the number of ordered trees (A000108) with n edges in which every non-leaf non-root vertex has at most one leaf child. The g.f. A(x) is given by A(x)= x/(1-x B(x)) where B(x)=1+x+2x^2+4x^3+... is the g.f. for A143363. [David Callan, Aug 22 2014]
Conjecturally, the number of sequences (e(1), ..., e(n-1)), 0 <= e(i) < i, such that there is no triple i < j < k with e(i) >= e(k). [Martinez and Savage, 2.10] - Eric M. Schmidt, Jul 17 2017
a(n) is the number of dissections of a convex (n+m)-sided polygon by non-intersecting diagonals such that the selected m consecutive sides of the polygon will be in the same subpolygon and create no triangles. - Muhammed Sefa Saydam, Jul 12 2025

Examples

			x + x^2 + 2*x^3 + 4*x^4 + 10*x^5 + 25*x^6 + 68*x^7 + 187*x^8 + 534*x^9 + ...
		

Programs

  • Mathematica
    a[1] = 1;
    a[n_] := SeriesCoefficient[InverseSeries[x(1+x-x^2)/(1+x)^2 + x O[x]^n, x], {x, 0, n}];
    Array[a, 28] (* Jean-François Alcover, Aug 17 2018, from PARI *)
    CoefficientList[InverseSeries[Series[x*(1 + x - x^2)/(1 + x)^2, {x, 0, 30}], x], x] (* Vaclav Kotesovec, Aug 17 2018 *)
  • PARI
    {a(n) = if( n<1, 0, polcoeff( serreverse( x * (1 + x - x^2) / (1 + x)^2 + x * O(x^n)), n))} /* Michael Somos, Jul 13 2003 */

Formula

Given g.f. A(x), then series reversion of B(x) = x + x * A(x) is -B(-x). - Michael Somos, Sep 07 2005
Given g.f. A(x), then B(x) = x + x * A(x) satisfies B(x) = x + C(x * B(x)) where C(x) is g.f. of A001764 offset 1.
D-finite with recurrence 5*n*(n-1)*(37*n-106)*a(n) -4*(n-1) *(74*n^2-323*n+288)*a(n-1) +16*(-74*n^3+508*n^2-1157*n+876)* a(n-2) +2*(2*n-5)*(37*n-69)*(n-4)*a(n-3)=0. - R. J. Mathar, Jun 24 2018
a(n) ~ (1+s)^2 / (2 * sqrt(Pi*(1+4*s)) * n^(3/2) * (s*(1 + s - s^2)/(1+s)^2)^(n - 1/2)), where s = 0.675130870566646070889621798150060480808032527677372732 = 2*cos(arctan(sqrt(37/27))/3)/sqrt(3) + 2*sin(arctan(sqrt(37/27))/3) - 1 is the root of the equation s^3 + 3*s^2 - s = 1. - Vaclav Kotesovec, Aug 17 2018
From Muhammed Sefa Saydam, Jul 12 2025: (Start)
a(n) = Sum_{k=1..n+1} A046736(k) * A046736(n-k+2), for A046736(1) = 1 and n >= 2.
a(n) = a(n-1) + Sum_{k=0..n-3} a(k) * A046736(n-k+1), for a(0) = 1 and n >= 3.
a(n) = a(n-1) + Sum_{k=1..n-2} A143363(k) * a(n-k-1), for a(0) = 1 and n >= 2. (End)

A143362 Triangle read by rows: T(n,k) is the number of ordered trees with n edges and k protected vertices (0<=k<=n-1). A protected vertex in an ordered tree is a vertex at least 2 edges away from its leaf descendants.

Original entry on oeis.org

1, 1, 1, 3, 1, 1, 6, 6, 1, 1, 17, 13, 10, 1, 1, 43, 50, 22, 15, 1, 1, 123, 141, 109, 33, 21, 1, 1, 343, 481, 325, 205, 46, 28, 1, 1, 1004, 1491, 1286, 631, 351, 61, 36, 1, 1, 2938, 4929, 4280, 2861, 1101, 562, 78, 45, 1, 1, 8791, 15840, 15662, 10025, 5676, 1783, 855, 97
Offset: 1

Views

Author

Emeric Deutsch, Aug 20 2008

Keywords

Comments

Row sums are the Catalan numbers (A000108).
Sum(k*T(n,k),k>=0) = A014301(n).
T(n,0) = A143363(n)

Examples

			T(3,2)=1 because among the five ordered trees with 3 edges only the path tree has 2 vertices at least two edges away from the leaf.
Triangle starts:
1;
1,1;
3,1,1;
6,6,1,1;
17,13,10,1,1;
43,50,22,15,1,1;
		

Crossrefs

Programs

  • Maple
    eq:=G-1/(1-z*G)-z*(t-1)*(G-1)/(1+z-z*G): G:=RootOf(eq,G): Gser:=simplify(series(G-1,z=0,13)): for n to 11 do P[n]:=sort(expand(coeff(Gser,z,n))) end do: for n to 11 do seq(coeff(P[n],t,j),j=0..n-1) end do; # yields sequence in triangular form

Formula

G.f.: G-1, where G=G(t,z) satisfies G = 1/(1-zG) + z(t-1)(G-1)/(1+z-zG).

A358460 Number of locally disjoint ordered rooted trees with n nodes.

Original entry on oeis.org

1, 1, 2, 5, 13, 36, 103, 301, 902, 2767, 8637, 27324, 87409, 282319, 919352
Offset: 1

Views

Author

Gus Wiseman, Nov 19 2022

Keywords

Comments

Locally disjoint means no branch of any vertex overlaps a different (unequal) branch of the same vertex.

Examples

			The a(1) = 1 through a(5) = 13 trees:
  o  (o)  (oo)   (ooo)    (oooo)
          ((o))  ((o)o)   ((o)oo)
                 ((oo))   ((oo)o)
                 (o(o))   ((ooo))
                 (((o)))  (o(o)o)
                          (o(oo))
                          (oo(o))
                          (((o))o)
                          (((o)o))
                          (((oo)))
                          ((o(o)))
                          (o((o)))
                          ((((o))))
		

Crossrefs

The locally non-intersecting version is A143363, unordered A007562.
The unordered version is A316473, ranked by A316495.
A000108 counts ordered rooted trees, unordered A000081.
A358453 counts transitive ordered trees, unordered A290689.

Programs

  • Mathematica
    aot[n_]:=If[n==1,{{}},Join @@ Table[Tuples[aot/@c],{c,Join@@Permutations/@IntegerPartitions[n-1]}]];
    Table[Length[Select[aot[n],FreeQ[#,{_,{_,x_,_},_,{_,x_,_},_}]&]],{n,10}]
Showing 1-8 of 8 results.