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 10 results.

A019497 Number of ternary search trees on n keys.

Original entry on oeis.org

1, 1, 1, 3, 6, 16, 42, 114, 322, 918, 2673, 7875, 23457, 70551, 213846, 652794, 2004864, 6190612, 19207416, 59850384, 187217679, 587689947, 1850692506, 5845013538, 18509607753, 58759391013, 186958014766, 596108115402, 1904387243796, 6095040222192, 19540540075824
Offset: 0

Views

Author

James Fill (jimfill(AT)jhu.edu)

Keywords

Crossrefs

Programs

  • Maple
    A:= proc(n) option remember; if n=0 then 1 else convert(series(1+x+x^2*A(n-1)^3, x=0,n+1), polynom) fi end: a:= n-> coeff(A(n), x,n): seq(a(n), n=0..27); # Alois P. Heinz, Aug 22 2008
  • Mathematica
    a[0] = 1; a[n_] := Sum[Binomial[1*(n-k), k]/(n-k)*Binomial[3*k, n-k-1], {k, 0, n-1}]; Table[a[n], {n, 0, 27}] (* Jean-François Alcover, Apr 07 2015, after Paul D. Hanna *)
  • PARI
    v=vector(50,j,1);for(n=3,50,A=sum(i=1,n,sum(j=1,n,sum(k=1,n,if(i+j+k-n,0,v[i]*v[j]*v[k]))));v[n]=A);a(n)=v[n+1];
    
  • PARI
    {a(n)= local(A); if(n<0, 0, A= 1+O(x); forstep(k= 1, n, 2, A= 1+x+x*x*A^3); polcoeff(A, n))} /* Michael Somos, Mar 29 2007 */
    
  • PARI
    {a(n)= if(n<0, 0, (-1)^n* polcoeff( serreverse((1-sqrt(1-4*x+4*x^3+x^2*O(x^n)))/2), n+1))} /* Michael Somos, Mar 29 2007 */
    
  • PARI
    a(n)=if(n==0,1,sum(k=0,n-1,binomial(1*(n-k),k)/(n-k)*binomial(3*k,n-k-1))) \\ Paul D. Hanna, Jun 16 2009

Formula

a(0)=a(1)=1 and for n>=2 a(n)= sum( i+j+k=n-2, a(i)*a(j)*a(k) ) (i, j, k>=0). - Benoit Cloitre, Jun 14 2004
G.f. A(x) satisfies A(x)= 1+ x+ x^2*A(x)^3. - Michael Somos, Mar 29 2007
Given g.f. A(x), then x*A(-x) is series reversion of A025262(n-1). - Michael Somos, Mar 29 2007
a(n) = Sum_{k=0..n-1} C(n-k,k)/(n-k) * C(3*k,n-k-1) for n>0 with a(0)=1. - Paul D. Hanna, Jun 16 2009
a(n) ~ (8 + 3*sqrt(3))^(1/4) * 3^(n/2 - 3/8) * (3 + sqrt(9 + 8*sqrt(3)))^(n + 1/2) / (sqrt(Pi) * n^(3/2) * 2^(2*n + 2)). - Vaclav Kotesovec, Jul 31 2021

Extensions

More terms from Olivier Gérard, Jul 1997

A056010 Number of words of length n in a simple grammar.

Original entry on oeis.org

1, 1, 3, 8, 23, 68, 207, 644, 2040, 6558, 21343, 70186, 232864, 778550, 2620459, 8872074, 30195288, 103246502, 354508628, 1221846856, 4225644866, 14659644348, 51002664023, 177909901566, 622093882290, 2180123564130, 7656055966092
Offset: 0

Views

Author

Michael Somos, Aug 01 2000

Keywords

Comments

The grammar defines a language L consisting of words from the alphabet S = {e, w, n, s}. If each letter in S is regarded as an integer lattice step, e = (1,0), w = (-1,0), n = (0,1), s = (0,-1), then each word is a path in the two-dimensional integer lattice starting from (0,0), never going below the x-axis and ending on the x-axis. Thus, this is a variant of Motzkin paths with two kinds of level steps. The algebraic definition is L = 1 + Le + Lw + LnLs - w where each word is regarded as a noncommutative monomial with variables in S. Replacing each letter in S by x and L by the g.f. A(x) leads to x + A(x) = (1 + x*A(x))^2. If we let y = x + x*x*A, then y^2 - y = x^3 - x which is an elliptic curve. - Michael Somos, Mar 28 2020
The Hankel number wall for the sequence L(0), L(1), ... has a zigzag diagonal sequence b(0) = 1, b(1) = 1. b(2) = e, b(3) = ew+ns, b(4) = na(ee-ew-ns), ... which is a generalized Somos-5 sequence with b(i)*b(i+5) = -n*s*b(i+1)*b(i+4) + e*n*s*b(i+2)*b(i+3). Define sequence c(0) = 0, c(1) = 1, c(i) = b(i-2) for i>1, and c(i) = -(-n*s)^(-i)*c(-i) if i<0. Then c(i)*c(i+5) = -n*s*c(i+1)*c(i+4) + e*n*s*c(i+2)*c(i+3) for all i in Z. If e=w=n=s=1, then c(i) = A006769(i) * (-1)^[mod(i,4)=3]. - Michael Somos, Oct 14 2024

Examples

			L(0) = 1, L(1) = e, L(2) = ee + ew + ns, L(3) = eee + ewe + nse + eew + eww + nsw + nes + ens.
G.f. = 1 + x + 3*x^2 + 8*x^3 + 23*x^4 + 68*x^5 + 207*x^6 + 644*x^7 + ...
		

Crossrefs

Programs

  • Mathematica
    CoefficientList[Series[(1 - 2 x - Sqrt[1 - 4 x + 4 x^3])/(2 x^2), {x, 0, 26}], x] (* Michael De Vlieger, Oct 30 2019 *)
    a[ n_] := SeriesCoefficient[ (2 - 2*x)/(1 - 2*x + (1 - 4*x + 4*x^3)^(1/2)), {x, 0, n}]; (* Michael Somos, Oct 27 2024 *)
    a[ n_] := If[ n<0, 0, SeriesCoefficient[Nest[(1 + x*#)^2 - x&, 1 + O[x], n], {x, 0, n}]]; (* Michael Somos, Oct 27 2024 *)
  • PARI
    {a(n) = if( n<0, 0, polcoef( (1 - 2*x - sqrt( 1 - 4*x + 4*x^3 + x^3 * O(x^n)) ) / (2*x^2), n))};
    
  • PARI
    {a(n) = if( n<0, 0, polcoef( (2 - 2*x)/(1 - 2*x + (1 - 4*x + 4*x^3 + x*O(x^n))^(1/2)), n))}; /* Michael Somos, Oct 27 2024 */

Formula

L = 1 + Le + Lw + LnLs - w.
a(n) = 2*a(n-1) + a(0)*a(n-2) + ... + a(n-2)*a(0) for n>1.
The Somos-4 sequence A006720(n+2) is the Hankel transform of a(n-1). See A001906 for definition of Hankel transform.
Let s(n)= A006769(n). Then 0 = f( -s(n-1) * s(n+1) / s(n)^2, -s(n) * s(n+2) / s(n+1)^2 ) where f(u, v) = u + v - (1 + u*v)^2.
G.f. A(x) satisfies 0 = f(x, A(x)) where f(u, v) = u + v - (1 + u*v)^2.
G.f.: (1 - 2*x - sqrt( 1 - 4*x + 4*x^3) ) / (2*x^2).
From Paul Barry, Mar 04 2010: (Start)
G.f.: ((1-x)/(1-2x))c(x^2(1-x)/(1-2x)^2), c(x) the g.f. of A000108;
a(n) = Sum_{k=0..floor(n/2)} (A000108(k) * Sum_{i=0..k+1} C(k+1,i)*C(n-i,n-2k-i)*(-1)^i*2^(n-2k-i)). (End)
a(n) = A025262(n+2) if n >= 0.
0 = a(n)*(+16*a(n+1) - 64*a(n+3) + 22*a(n+4)) + a(n+1)*(+32*a(n+2) - 14*a(n+3)) + a(n+2)*(+16*a(n+3) - 10*a(n+4)) + a(n+3)*(+2*a(n+3) + a(n+4)) if n>=0. - Michael Somos, Jan 18 2015

A160702 Sequence such that the Hankel transform of a(n+1) satisfies a generalized Somos-4 recurrence.

Original entry on oeis.org

1, 1, 1, 5, 19, 79, 333, 1441, 6351, 28451, 129185, 593373, 2752427, 12876343, 60684533, 287857209, 1373286375, 6584979659, 31719337353, 153416338549, 744777567043, 3627787084319
Offset: 0

Views

Author

Paul Barry, May 24 2009

Keywords

Comments

The Hankel transform of a(n+1) satisfies a generalized Somos-4 Hankel determinant recurrence.
Hankel transform of a(n+1) is A160703. In general, we can conjecture that the Hankel transform of
h(n) of a(n+1), where a(n)=if(n=0,1,if(n=1,1,if(n=2,1,r*a(n-1)+s*sum{k=0..n-2, a(k)*a(n-1-k)}))),
satisfies the generalized Somos-4 recurrence
h(n)=(s^2*h(n-1)*h(n-3)+s^3*(2*s+r-2)*h(n-2)^2)/h(n-4).
The case r=s=1 is proved in the Xin reference.

Crossrefs

Programs

  • Mathematica
    CoefficientList[Series[1/4+(1-Sqrt[16*x^3+x^2-6*x+1])/(4*x),{x,0,20}],x] (* Vaclav Kotesovec, Nov 20 2012 *)

Formula

a(n) = if(n=0,1,if(n=1,1,if(n=2,1,a(n-1)+2*sum{k=0..n-2, a(k)*a(n-1-k)})))
Recurrence: (n+1)*a(n) = 3*(2*n-1)*a(n-1) - (n-2)*a(n-2) - 8*(2*n-7)*a(n-3). - Vaclav Kotesovec, Nov 20 2012
G.f.: 1/4+(1-sqrt(16*x^3+x^2-6*x+1))/(4*x). - Vaclav Kotesovec, Nov 20 2012

A157002 Transform of Catalan numbers whose Hankel transform gives the Somos-4 sequence.

Original entry on oeis.org

1, 0, 1, 2, 6, 17, 51, 156, 488, 1552, 5006, 16337, 53849, 179015, 599535, 2020924, 6851150, 23344138, 79902364, 274606264, 947240592, 3278404274, 11381240074, 39621423949, 138288477617, 483805404673, 1696318159457, 5959737806635
Offset: 0

Views

Author

Paul Barry, Feb 20 2009

Keywords

Comments

Image of the Catalan numbers A000108 by the Riordan array (1-x,x(1-x^2)). Hankel transform is A006720(n+1).
The sequence a(n)+a(n+1) begins 1,1,3,8,23,68,... which is A056010. The sequence a(n)+a(n-1) begins 1,1,1,3,8,23,68,... which is A025262. This is obtained by applying (1-x^2,x(1-x^2)) to the Catalan numbers.
Hankel transform of a(n+1) is -A051138(n). - Michael Somos, Feb 10 2015

Examples

			G.f. = 1 + x^2 + 2*x^3 + 6*x^4 + 17*x^5 + 51*x^6 + 156*x^7 + 488*x^8 + ...
		

Crossrefs

Programs

  • Magma
    m:=30; R:=PowerSeriesRing(Rationals(), m); Coefficients(R!( (1 -Sqrt(1-4*x*(1-x^2)))/(2*x*(1+x)) )); // G. C. Greubel, Feb 26 2019
    
  • Mathematica
    CoefficientList[Series[(1-Sqrt[1-4x(1-x^2)])/(2x(1+x)), {x,0,30}], x] (* G. C. Greubel, Feb 26 2019 *)
  • PARI
    {a(n) = if( n<0, -(-1)^n / 2 * (n<-1), polcoeff( (1 - sqrt(1 - 4*x * (1 - x^2) + x^2 * O(x^n))) / (2 * x * (1 + x)), n))}; /* Michael Somos, Feb 10 2015 */
    
  • Sage
    ((1-sqrt(1-4*x*(1-x^2)))/(2*x*(1+x))).series(x, 30).coefficients(x, sparse=False) # G. C. Greubel, Feb 26 2019

Formula

G.f.: (1 - sqrt(1-4*x*(1-x^2)))/(2*x*(1+x)).
a(n) = Sum_{k=0..n} (-1)^floor((n-k+1)/2)*C(k,floor((n-k)/2))*A000108(k).
Conjecture: (n+1)*a(n) +3*(-n+1)*a(n-1) +2*(-2*n+1)*a(n-2) +2*(2*n-7)*a(n-3) +2*(2*n-7)*a(n-4)=0. - R. J. Mathar, Nov 19 2014
0 = a(n)*(+16*a(n+1) + 16*a(n+2) - 64*a(n+3) - 42*a(n+4) + 22*a(n+5)) + a(n+1)*(+16*a(n+1) + 48*a(n+2) - 46*a(n+3) - 56*a(n+4) + 22*a(n+5)) + a(n+2)*(+32*a(n+2) + 34*a(n+3) - 8*a(n+4) - 10*a(n+5)) + a(n+3)*(+18*a(n+3) + 11*a(n+4) - 9*a(n+5)) + a(n+4)*(+3*a(n+4) + a(n+5)) for all n in Z. - Michael Somos, Feb 10 2015

A025268 a(n) = a(1)*a(n-1) + a(2)*a(n-2) + ...+ a(n-1)*a(1) for n >= 5, with initial values 1,1,1,1.

Original entry on oeis.org

1, 1, 1, 1, 4, 11, 32, 95, 284, 860, 2630, 8115, 25242, 79080, 249342, 790719, 2520546, 8072216, 25961150, 83814536, 271538192, 882527618, 2876712308, 9402284815, 30806948110, 101172278362, 332965892290, 1097990333320, 3627433618396
Offset: 1

Views

Author

Keywords

Crossrefs

Programs

  • Maple
    Phi:=proc(t,u,M) local i,a; a:=Array(0..M);
    for i from 0 to t-1 do a[i]:=u[i+1]; od:
    for i from t to M do a[i]:=a[i-1]+add(a[j]*a[i-1-j],j=0..i-2); od:
    [seq(a[i],i=0..M)]; end;
    Phi(4,[1,1,1,1],30);
    # N. J. A. Sloane, Oct 29 2008
  • Mathematica
    nmax = 30; aa = ConstantArray[0,nmax]; aa[[1]] = 1; aa[[2]] = 1; aa[[3]] = 1; aa[[4]] = 1; Do[aa[[n]] = Sum[aa[[k]]*aa[[n-k]],{k,1,n-1}],{n,5,nmax}]; aa (* Vaclav Kotesovec, Jan 25 2015 *)

Formula

Given an integer t >= 1 and initial values u = [a_0, a_1, ..., a_{t-1}], we may define an infinite sequence Phi(u) by setting a_n = a_{n-1} + a_0*a_{n-1} + a_1*a_{n-2} + ... + a_{n-2}*a_1 for n >= t. For example, Phi([1]) is the Catalan numbers A000108. The present sequence is Phi([1,1,1,1]). - Gary W. Adamson, Oct 27 2008
Conjecture: n*a(n) +(n+1)*a(n-1) +10*(-2*n+5)*a(n-2) +2*(2*n-9)*a(n-3) +2*(14*n-79)*a(n-4) +40*(n-7)*a(n-5)=0. - R. J. Mathar, Jan 25 2015
G.f.: 1/2 - sqrt(8*x^4+4*x^3-4*x+1)/2. - Vaclav Kotesovec, Jan 25 2015
Recurrence: n*a(n) = 2*(2*n-3)*a(n-1) - 2*(2*n-9)*a(n-3) - 8*(n-6)*a(n-4). - Vaclav Kotesovec, Jan 25 2015

A157100 Transform of Catalan numbers whose Hankel transform satisfies the Somos-4 recurrence.

Original entry on oeis.org

1, 2, 3, 6, 14, 37, 105, 312, 956, 2996, 9554, 30897, 101083, 333947, 1112497, 3732956, 12605030, 42800318, 146046820, 500555448, 1722402304, 5948047170, 20607691518, 71610355541, 249520257107, 871614139397, 3051737703527
Offset: 0

Views

Author

Paul Barry, Feb 22 2009

Keywords

Comments

Hankel transform is A157101.
The ratio of this generating function by the generating function of A025262 is x*(1-x), which means this sequence is the partial sums of A025262. - Sean A. Irvine, R. J. Mathar, Jun 27 2022

Crossrefs

Partial sums of A025262.

Programs

  • Mathematica
    a[n_]:= Sum[(-1)^Binomial[k, 2]*Binomial[n-k, Floor[k/2]]*CatalanNumber[n-k], {k,0,n}];
    Table[a[n], {n, 0, 40}] (* G. C. Greubel, Jan 11 2022 *)
  • Sage
    def A157100(n): return sum((-1)^binomial(k,2)*binomial(n-k, k//2)*catalan_number(n-k) for k in (0..n))
    [A157100(n) for n in (0..40)] # G. C. Greubel, Jan 11 2022

Formula

G.f.: (1+x)*c(x*(1-x^2)), c(x) the g.f. of A000108;
a(n) = Sum_{k=0..n} (-1)^binomial(n-k,2)*binomial(k,floor((n-k)/2))*A000108(k).
Conjecture: (n+1)*a(n) +(-5*n+1)*a(n-1) +2*(2*n-1)*a(n-2) +2*(2*n-7)*a(n-3) +2*(-2*n+7)*a(n-4) = 0. - R. J. Mathar, Feb 05 2015

A168151 Riordan array (1/u,(1-u)/2), u=sqrt(1-4x+4*x^3).

Original entry on oeis.org

1, 2, 1, 6, 3, 1, 18, 9, 4, 1, 58, 29, 13, 5, 1, 192, 96, 44, 18, 6, 1, 650, 325, 151, 64, 24, 7, 1, 2232, 1116, 524, 228, 90, 31, 8, 1, 7746, 3873, 1833, 813, 333, 123, 39, 9, 1, 27096, 13548, 6452, 2904, 1222, 473, 164, 48, 10, 1
Offset: 0

Views

Author

Philippe Deléham, Nov 19 2009

Keywords

Comments

T(n,0) = A157004(n).

Examples

			Triangle begins:
  1
  2 1
  6 3 1
  18 9 4 1
  58 29 13 5 1
  192 96 44 18 6 1
  650 325 151 64 24 7 1
  ...
		

References

  • Baccherini, D.; Merlini, D.; Sprugnoli, R. Binary words excluding a pattern and proper Riordan arrays. Discrete Math. 307 (2007), no. 9-10, 1021--1037. MR2292531 (2008a:05003). See Example 5.6. - N. J. A. Sloane, Mar 25 2014

Crossrefs

Formula

T(n,0) = 2*T(n,1) for n>0, T(0,0) = 1, T(n,k) = T(n-1,k-1)-T(n-3,k-1)+T(n,k+1).

A176703 Coefficients of a recursive polynomial based on Chaitin's S expressions: a(0)=1; a(1)=x; a(2)=1; a(n)=vector(a(n-1)).reverse(a(n-1)).

Original entry on oeis.org

1, 0, 1, 1, 0, 2, 0, 1, 4, 2, 2, 9, 8, 4, 2, 22, 24, 14, 8, 56, 70, 52, 24, 5, 146, 208, 176, 84, 30, 388, 624, 574, 320, 120, 14, 1048, 1876, 1868, 1184, 470, 112, 2869, 5648, 6088, 4236, 1900, 560, 42, 7942, 17040, 19804, 14928, 7560, 2492, 420, 22192, 51526, 64232
Offset: 0

Views

Author

Roger L. Bagula, Apr 24 2010

Keywords

Comments

The result is an alternative way to expand s expressions as a binary rooted tree recursion.

Examples

			{1},
{0, 1},
{1, 0},
{2, 0, 1},
{4, 2, 2},
{9, 8, 4, 2},
{22, 24, 14, 8},
{56, 70, 52, 24, 5},
{146, 208, 176, 84, 30},
{388, 624, 574, 320, 120, 14},
{1048, 1876, 1868, 1184, 470, 112},
{2869, 5648, 6088, 4236, 1900, 560, 42},
{7942, 17040, 19804, 14928, 7560, 2492, 420},
{22192, 51526, 64232, 52208, 29190, 10864, 2520, 132},
{62510, 156128, 207808, 181320, 110260, 46256, 12684, 1584},
{177308, 473952, 670966, 625408, 410400, 190932, 59976, 11088, 429}
		

References

  • G. J. Chaitin, Algorithmic Information Theory, Cambridge Press, 1987, page 169

Crossrefs

Programs

  • Mathematica
    a[0] := 1; a[1] := x; a[2] = 1;
    a[n_] := a[n] = Table[a[i], {i, 0, n - 1}].Table[a[n - 1 - i], {i, 0, n - 1}];
    Table[ CoefficientList[a[n], x], {n, 0, 15}];
    Flatten[%]
  • PARI
    {T(n, k) = if( 2*k-1  > n, 0, polcoeff( polcoeff( ( 1 - sqrt( (1 - 2*x)^2 - 4*x^2 * (x + y - 2*x*y) + x^2*O(x^n))) / (2*x), n), k))} /* Michael Somos, Jan 09 2012 */

Formula

a(0)=1;a(1)=x;a(2)=1;
a(n)=vector(a(n-1)).reverse(a(n-1));
t(n,m)=coefficients(a(n) in x)
Let b(0) = b(2) = 1, b(1) = x, and b(n) = Sum_{i=1..n} b(i-1) * b(n-i) if n>2. Then T(n, k) = coefficient of x^k in b(n) where 0 <= k <= (n+1)/2.
G.f. A(x,y) satisfies A(x,y) = 1 - x * (1 - x - y + 2*x*y) + x * A(x,y)^2. - Michael Somos, Jan 09 2012
G.f.: ( 1 - sqrt( (1 - 2*x)^2 - 4*x^2 * (x + y - 2*x*y) )) / (2*x). - Michael Somos, Jan 09 2012
Row sums are A025262 if offset 0.

A367044 G.f. satisfies A(x) = 1 - x^2 + x*A(x)^3.

Original entry on oeis.org

1, 1, 2, 9, 40, 192, 963, 5000, 26649, 144990, 802023, 4497150, 25504380, 146037955, 843134220, 4902661503, 28686940053, 168785282241, 997968554037, 5926617173205, 35335723342962, 211433954924955, 1269252184538408, 7642065274626855, 46137678521488140
Offset: 0

Views

Author

Seiichi Manyama, Nov 03 2023

Keywords

Crossrefs

Programs

  • PARI
    a(n) = sum(k=0, n\2, (-1)^k*binomial(2*(n-2*k)+1, k)*binomial(3*(n-2*k), n-2*k)/(2*(n-2*k)+1));

Formula

a(n) = Sum_{k=0..floor(n/2)} (-1)^k * binomial(2*(n-2*k)+1,k) * binomial(3*(n-2*k),n-2*k)/(2*(n-2*k)+1).

A367045 G.f. satisfies A(x) = 1 - x^2 + x*A(x)^4.

Original entry on oeis.org

1, 1, 3, 18, 112, 755, 5348, 39302, 296916, 2291861, 17997052, 143319918, 1154728056, 9395809374, 77099733884, 637298480966, 5301568498768, 44351526986704, 372890978840156, 3149155955471690, 26702387443603200, 227238745573918511, 1940201017862028108
Offset: 0

Views

Author

Seiichi Manyama, Nov 03 2023

Keywords

Crossrefs

Programs

  • PARI
    a(n) = sum(k=0, n\2, (-1)^k*binomial(3*(n-2*k)+1, k)*binomial(4*(n-2*k), n-2*k)/(3*(n-2*k)+1));

Formula

a(n) = Sum_{k=0..floor(n/2)} (-1)^k * binomial(3*(n-2*k)+1,k) * binomial(4*(n-2*k),n-2*k)/(3*(n-2*k)+1).
Showing 1-10 of 10 results.