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

A126120 Catalan numbers (A000108) interpolated with 0's.

Original entry on oeis.org

1, 0, 1, 0, 2, 0, 5, 0, 14, 0, 42, 0, 132, 0, 429, 0, 1430, 0, 4862, 0, 16796, 0, 58786, 0, 208012, 0, 742900, 0, 2674440, 0, 9694845, 0, 35357670, 0, 129644790, 0, 477638700, 0, 1767263190, 0, 6564120420, 0, 24466267020, 0, 91482563640, 0, 343059613650, 0
Offset: 0

Views

Author

Philippe Deléham, Mar 06 2007

Keywords

Comments

Inverse binomial transform of A001006.
The Hankel transform of this sequence gives A000012 = [1,1,1,1,1,...].
Counts returning walks (excursions) of length n on a 1-d integer lattice with step set {+1,-1} which stay in the chamber x >= 0. - Andrew V. Sutherland, Feb 29 2008
Moment sequence of the trace of a random matrix in G=USp(2)=SU(2). If X=tr(A) is a random variable (A distributed according to the Haar measure on G) then a(n) = E[X^n]. - Andrew V. Sutherland, Feb 29 2008
Essentially the same as A097331. - R. J. Mathar, Jun 15 2008
Number of distinct proper binary trees with n nodes. - Chris R. Sims (chris.r.sims(AT)gmail.com), Jun 30 2010
-a(n-1), with a(-1):=0, n>=0, is the Z-sequence for the Riordan array A049310 (Chebyshev S). For the definition see that triangle. - Wolfdieter Lang, Nov 04 2011
See A180874 (also A238390 and A097610) and A263916 for relations to the general Bell A036040, cycle index A036039, and cumulant expansion polynomials A127671 through the Faber polynomials. - Tom Copeland, Jan 26 2016
A signed version is generated by evaluating polynomials in A126216 that are essentially the face polynomials of the associahedra. This entry's sequence is related to an inversion relation on p. 34 of Mizera, related to Feynman diagrams. - Tom Copeland, Dec 09 2019

Examples

			G.f. = 1 + x^2 + 2*x^4 + 5*x^6 + 14*x^8 + 42*x^10 + 132*x^12 + 429*x^14 + ...
From _Gus Wiseman_, Nov 14 2022: (Start)
The a(0) = 1 through a(8) = 14 ordered binary rooted trees with n + 1 nodes (ranked by A358375):
  o  .  (oo)  .  ((oo)o)  .  (((oo)o)o)  .  ((((oo)o)o)o)
                 (o(oo))     ((o(oo))o)     (((o(oo))o)o)
                             ((oo)(oo))     (((oo)(oo))o)
                             (o((oo)o))     (((oo)o)(oo))
                             (o(o(oo)))     ((o((oo)o))o)
                                            ((o(o(oo)))o)
                                            ((o(oo))(oo))
                                            ((oo)((oo)o))
                                            ((oo)(o(oo)))
                                            (o(((oo)o)o))
                                            (o((o(oo))o))
                                            (o((oo)(oo)))
                                            (o(o((oo)o)))
                                            (o(o(o(oo))))
(End)
		

References

  • Jerome Spanier and Keith B. Oldham, "Atlas of Functions", Ch. 49, Hemisphere Publishing Corp., 1987.

Crossrefs

Cf. A126216.
The unordered version is A001190, ranked by A111299.
These trees (ordered binary rooted) are ranked by A358375.

Programs

  • Magma
    &cat [[Catalan(n), 0]: n in [0..30]]; // Vincenzo Librandi, Jul 28 2016
    
  • Maple
    with(combstruct): grammar := { BB = Sequence(Prod(a,BB,b)), a = Atom, b = Atom }: seq(count([BB,grammar], size=n),n=0..47); # Zerinvary Lajos, Apr 25 2007
    BB := {E=Prod(Z,Z), S=Union(Epsilon,Prod(S,S,E))}: ZL:=[S,BB,unlabeled]: seq(count(ZL, size=n), n=0..45); # Zerinvary Lajos, Apr 22 2007
    BB := [T,{T=Prod(Z,Z,Z,F,F), F=Sequence(B), B=Prod(F,Z,Z)}, unlabeled]: seq(count(BB, size=n+1), n=0..45); # valid for n> 0. # Zerinvary Lajos, Apr 22 2007
    seq(n!*coeff(series(hypergeom([],[2],x^2),x,n+2),x,n),n=0..45); # Peter Luschny, Jan 31 2015
    # Using function CompInv from A357588.
    CompInv(48, n -> ifelse(irem(n, 2) = 0, 0, (-1)^iquo(n-1, 2))); # Peter Luschny, Oct 07 2022
  • Mathematica
    a[n_?EvenQ] := CatalanNumber[n/2]; a[n_] = 0; Table[a[n], {n, 0, 45}] (* Jean-François Alcover, Sep 10 2012 *)
    a[ n_] := If[ n < 0, 0, n! SeriesCoefficient[ BesselI[ 1, 2 x] / x, {x, 0, n}]]; (* Michael Somos, Mar 19 2014 *)
    bot[n_]:=If[n==1,{{}},Join@@Table[Tuples[bot/@c],{c,Table[{k,n-k-1},{k,n-1}]}]];
    Table[Length[bot[n]],{n,10}] (* Gus Wiseman, Nov 14 2022 *)
    Riffle[CatalanNumber[Range[0,50]],0,{2,-1,2}] (* Harvey P. Dale, May 28 2024 *)
  • Python
    from math import comb
    def A126120(n): return 0 if n&1 else comb(n,m:=n>>1)//(m+1) # Chai Wah Wu, Apr 22 2024
  • Sage
    def A126120_list(n) :
        D = [0]*(n+2); D[1] = 1
        b = True; h = 2; R = []
        for i in range(2*n-1) :
            if b :
                for k in range(h,0,-1) : D[k] -= D[k-1]
                h += 1; R.append(abs(D[1]))
            else :
                for k in range(1,h, 1) : D[k] += D[k+1]
            b = not b
        return R
    A126120_list(46) # Peter Luschny, Jun 03 2012
    

Formula

a(2*n) = A000108(n), a(2*n+1) = 0.
a(n) = A053121(n,0).
(1/Pi) Integral_{0 .. Pi} (2*cos(x))^n *2*sin^2(x) dx. - Andrew V. Sutherland, Feb 29 2008
G.f.: (1 - sqrt(1 - 4*x^2)) / (2*x^2) = 1/(1-x^2/(1-x^2/(1-x^2/(1-x^2/(1-... (continued fraction). - Philippe Deléham, Nov 24 2009
G.f. A(x) satisfies A(x) = 1 + x^2*A(x)^2. - Vladimir Kruchinin, Feb 18 2011
E.g.f.: I_1(2x)/x Where I_n(x) is the modified Bessel function. - Benjamin Phillabaum, Mar 07 2011
Apart from the first term the e.g.f. is given by x*HyperGeom([1/2],[3/2,2], x^2). - Benjamin Phillabaum, Mar 07 2011
a(n) = Integral_{x=-2..2} x^n*sqrt((2-x)*(2+x))/(2*Pi) dx. - Peter Luschny, Sep 11 2011
E.g.f.: E(0)/(1-x) where E(k) = 1-x/(1-x/(x-(k+1)*(k+2)/E(k+1))); (continued fraction). - Sergei N. Gladkovskii, Apr 05 2013
G.f.: 3/2- sqrt(1-4*x^2)/2 = 1/x^2 + R(0)/x^2, where R(k) = 2*k-1 - x^2*(2*k-1)*(2*k+1)/R(k+1); (continued fraction). - Sergei N. Gladkovskii, Oct 28 2013 (warning: this is not the g.f. of this sequence, R. J. Mathar, Sep 23 2021)
G.f.: 1/Q(0), where Q(k) = 2*k+1 + x^2*(1-4*(k+1)^2)/Q(k+1); (continued fraction). - Sergei N. Gladkovskii, Jan 09 2014
a(n) = n!*[x^n]hypergeom([],[2],x^2). - Peter Luschny, Jan 31 2015
a(n) = 2^n*hypergeom([3/2,-n],[3],2). - Peter Luschny, Feb 03 2015
a(n) = ((-1)^n+1)*2^(2*floor(n/2)-1)*Gamma(floor(n/2)+1/2)/(sqrt(Pi)* Gamma(floor(n/2)+2)). - Ilya Gutkovskiy, Jul 23 2016
D-finite with recurrence (n+2)*a(n) +4*(-n+1)*a(n-2)=0. - R. J. Mathar, Mar 21 2021
From Peter Bala, Feb 03 2024: (Start)
a(n) = 2^n * Sum_{k = 0..n} (-2)^(-k)*binomial(n, k)*Catalan(k+1).
G.f.: 1/(1 + 2*x) * c(x/(1 + 2*x))^2 = 1/(1 - 2*x) * c(-x/(1 - 2*x))^2 = c(x^2), where c(x) = (1 - sqrt(1 - 4*x))/(2*x) is the g.f. of the Catalan numbers A000108. (End)

Extensions

An erroneous comment removed by Tom Copeland, Jul 23 2016

A111299 Numbers whose Matula tree is a binary tree (i.e., root has degree 2 and all nodes except root and leaves have degree 3).

Original entry on oeis.org

4, 14, 49, 86, 301, 454, 886, 1589, 1849, 3101, 3986, 6418, 9761, 13766, 13951, 19049, 22463, 26798, 31754, 48181, 51529, 57026, 75266, 85699, 93793, 100561, 111139, 128074, 137987, 196249, 199591, 203878, 263431, 295969, 298154, 302426, 426058, 448259, 452411
Offset: 1

Views

Author

Keith Briggs, Nov 02 2005

Keywords

Comments

This sequence should probably start with 1. Then a number k is in the sequence iff k = 1 or k = prime(x) * prime(y) with x and y already in the sequence. - Gus Wiseman, May 04 2021

Examples

			From _Gus Wiseman_, May 04 2021: (Start)
The sequence of trees (starting with 1) begins:
     1: o
     4: (oo)
    14: (o(oo))
    49: ((oo)(oo))
    86: (o(o(oo)))
   301: ((oo)(o(oo)))
   454: (o((oo)(oo)))
   886: (o(o(o(oo))))
  1589: ((oo)((oo)(oo)))
  1849: ((o(oo))(o(oo)))
  3101: ((oo)(o(o(oo))))
  3986: (o((oo)(o(oo))))
  6418: (o(o((oo)(oo))))
  9761: ((o(oo))((oo)(oo)))
(End)
		

Crossrefs

Cf. A245824 (by number of leaves).
These trees are counted by 2*A001190 - 1.
The semi-binary version is A292050 (counted by A001190).
The semi-identity case is A339193 (counted by A063895).
A000081 counts unlabeled rooted trees with n nodes.
A007097 ranks rooted chains.
A276625 ranks identity trees, counted by A004111.
A306202 ranks semi-identity trees, counted by A306200.
A306203 ranks balanced semi-identity trees, counted by A306201.
A331965 ranks lone-child avoiding semi-identity trees, counted by A331966.

Programs

  • Mathematica
    nn=20000;
    primeMS[n_]:=If[n===1,{},Flatten[Cases[FactorInteger[n],{p_,k_}:>Table[PrimePi[p],{k}]]]];
    binQ[n_]:=Or[n===1,With[{m=primeMS[n]},And[Length[m]===2,And@@binQ/@m]]];
    Select[Range[2,nn],binQ] (* Gus Wiseman, Aug 28 2017 *)
  • PARI
    i(n)=n==2 || is(primepi(n))
    is(n)=if(n<14,return(n==4)); my(f=factor(n),t=#f[,1]); if(t>1, t==2 && f[1,2]==1 && f[2,2]==1 && i(f[1,1]) && i(f[2,1]), f[1,2]==2 && i(f[1,1])) \\ Charles R Greathouse IV, Mar 29 2013
    
  • PARI
    list(lim)=my(v=List(), t); forprime(p=2, sqrt(lim), t=p; forprime(q=p, lim\t, if(i(p)&&i(q), listput(v, t*q)))); vecsort(Vec(v)) \\ Charles R Greathouse IV, Mar 29 2013
    
  • PARI
    \\ Also see links.

Formula

The Matula tree of k is defined as follows:
matula(k):
create a node labeled k
for each prime factor m of k:
add the subtree matula(prime(m)), by an edge labeled m
return the node

Extensions

Definition corrected by Charles R Greathouse IV, Mar 29 2013
a(27)-a(39) from Charles R Greathouse IV, Mar 29 2013

A358375 Numbers k such that the k-th standard ordered rooted tree is binary.

Original entry on oeis.org

1, 4, 18, 25, 137, 262146, 393217, 2097161, 2228225
Offset: 1

Views

Author

Gus Wiseman, Nov 14 2022

Keywords

Comments

We define the n-th standard ordered rooted tree to be obtained by taking the (n-1)-th composition in standard order (graded reverse-lexicographic, A066099) as root and replacing each part with its own standard ordered rooted tree. This ranking is an ordered variation of Matula-Goebel numbers, giving a bijective correspondence between positive integers and unlabeled ordered rooted trees.

Examples

			The initial terms and their corresponding trees:
       1: o
       4: (oo)
      18: ((oo)o)
      25: (o(oo))
     137: ((oo)(oo))
  262146: (((oo)o)o)
  393217: (o((oo)o))
		

Crossrefs

The unordered version is A111299, counted by A001190
These trees are counted by A126120.
A000081 counts unlabeled rooted trees, ranked by A358378.
A358371 and A358372 count leaves and nodes in standard ordered rooted trees.

Programs

  • Mathematica
    stc[n_]:=Differences[Prepend[Join @@ Position[Reverse[IntegerDigits[n,2]],1],0]]//Reverse;
    srt[n_]:=If[n==1,{},srt/@stc[n-1]];
    Select[Range[1000],FreeQ[srt[#],[_]?(Length[#]!=2&)]&]

A298126 Matula-Goebel numbers of rooted trees in which all outdegrees are even.

Original entry on oeis.org

1, 4, 14, 16, 49, 56, 64, 86, 106, 196, 224, 256, 301, 344, 371, 424, 454, 526, 622, 686, 784, 886, 896, 1024, 1154, 1204, 1376, 1484, 1589, 1696, 1816, 1841, 1849, 2104, 2177, 2279, 2386, 2401, 2488, 2744, 2809, 2846, 3101, 3136, 3238, 3544, 3584, 3986, 4039
Offset: 1

Views

Author

Gus Wiseman, Jan 13 2018

Keywords

Examples

			Sequence of trees begins:
1   o
4   (oo)
14  (o(oo))
16  (oooo)
49  ((oo)(oo))
56  (ooo(oo))
64  (oooooo)
86  (o(o(oo)))
106 (o(oooo))
196 (oo(oo)(oo))
224 (ooooo(oo))
256 (oooooooo)
301 ((oo)(o(oo)))
344 (ooo(o(oo)))
371 ((oo)(oooo))
424 (ooo(oooo))
454 (o((oo)(oo)))
526 (o(ooo(oo)))
622 (o(oooooo))
686 (o(oo)(oo)(oo))
784 (oooo(oo)(oo))
886 (o(o(o(oo))))
896 (ooooooo(oo))
		

Crossrefs

Programs

  • Mathematica
    primeMS[n_]:=If[n===1,{},Flatten[Cases[FactorInteger[n],{p_,k_}:>Table[PrimePi[p],{k}]]]];
    etQ[n_]:=Or[n===1,With[{m=primeMS[n]},EvenQ@Length@m&&And@@etQ/@m]];
    Select[Range[10000],etQ]

A352456 Smallest Matula-Goebel number of a rooted binary tree (everywhere 0 or 2 children) of n childless vertices.

Original entry on oeis.org

1, 4, 14, 49, 301, 1589, 9761, 51529, 452411, 3041573, 23140153, 143573641, 1260538619, 8474639717, 64474684537
Offset: 1

Views

Author

Kevin Ryde, Mar 16 2022

Keywords

Comments

In the formula below, the two subtrees of the root have x and y childless vertices. The minimum Matula-Goebel number for that partition uses the minimum numbers for each subtree. The question is then which x+y partition is the overall minimum.

Examples

			For n = 6, the tree a(6) = 1589 is
.
        *   root
     /    \
    *      *       6 childless
   / \    / \      vertices "@"
  @  @   *   *
        / \ / \
        @ @ @ @
.
		

References

  • Audace A. V. Dossou-Olory. The topological trees with extreme Matula numbers. J. Combin. Math. Combin. Comput., 115 (2020), 215-225.

Crossrefs

Column 1 of A245824.
Cf. A111299 (all binary trees), A005517 (smallest all trees), A000040 (primes).

Programs

  • PARI
    \\ See links.
    
  • Python
    from sympy import prime
    from itertools import count, islice
    def agen(): # generator of terms
        alst, plst = [0, 1], [0, 2]
        yield 1
        for n in count(2):
            an = min(plst[x]*plst[n-x] for x in range(1, n//2+1))
            yield an
            alst.append(an)
            plst.append(prime(an))
    print(list(islice(agen(), 10))) # Michael S. Branicky, Mar 17 2022

Formula

a(n) = Min_{x+y=n} prime(a(x))*prime(a(y)).

Extensions

a(14) from Michael S. Branicky, Mar 17 2022
a(15) from Andrew Howroyd, Sep 17 2023
Showing 1-5 of 5 results.