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

A201805 Number of arrays of n integers in -2..2 with sum zero and equal numbers of elements greater than zero and less than zero.

Original entry on oeis.org

1, 1, 5, 13, 61, 221, 1001, 4145, 18733, 82381, 375745, 1703945, 7858225, 36279985, 168992045, 789433013, 3707816333, 17467638925, 82599195809, 391645961993, 1862242702201, 8875355178521, 42394598106965, 202903189757053
Offset: 0

Views

Author

R. H. Hardin, Dec 05 2011

Keywords

Comments

Column 2 of A201811.
Also the number of walks of length n from a vertex to itself on the infinite square lattice with a self loop on each vertex. - Pierre-Louis Giscard, Jun 25 2014
Also the number of 3D walks of length n in a half-space returning to axis of origin. - Nachum Dershowitz, Aug 04 2020
The central column of a number pyramid P(j,k,m), where P(j,k,m) = P(j,k,m-1) + P(j-1,k,m-1) + P(j+1,k,m-1) + P(j,k-1,m-1) + P(j,k+1,m-1). P(1,1,1) = 1. j, k = 1..2*m+1. m >=1. - Yuriy Sibirmovsky, Sep 17 2016
Row sums of A282252. - Peter Bala, Feb 12 2017

Examples

			Some solutions for n=9
.-1...-1....1....1....0...-2....2...-1...-2...-2....1....1....1....2....0....1
..1...-2...-2...-2...-1...-2....1....0....2....1....0...-2...-1...-2....0...-1
..0....0....2....1...-1....2...-1....1....0...-2...-1....1...-2....1...-1....1
.-1...-2....2....0...-2....1....0....2....0....0...-1...-1....2...-1....0....1
..2....1....0....2...-1....0....1...-2...-1...-1....1....0...-2....1....0...-1
..0....2...-2...-1....2....0...-2...-2....0....2....1...-1...-2....2....2....1
..1....1...-2....1....1...-1....0....2....1...-2....0....2....2...-2...-2...-1
..0...-1....2...-1....1....2...-1...-2....1....2...-1...-2....0....0....0....0
.-2....2...-1...-1....1....0....0....2...-1....2....0....2....2...-1....1...-1
		

Crossrefs

Sum_{k=0..n} C(n,2k)*C(2k,k)^m: A002426 (m=1), this sequence (m=2).

Programs

  • Mathematica
    a[n_]=HypergeometricPFQ[{1/2, 1/2 - n/2, -(n/2)}, {1, 1}, 16]; (* or *)
    a[n_]=Sum[Binomial[n, 2 k] Binomial[2 k, k]^2, {k, 0, n}]; (* or *)
    Hypergeometric2F1[1/2, 1/2, 1, 16*x^2/(1 - x)^2]/(1 - x); (* O.g.f. *)
    Exp[x] BesselI[0, 2 x] BesselI[0, 2 x]; (* E.g.f. *)(* Pierre-Louis Giscard, Jun 25 2014 *)
    Nm=100;
    C1=Table[0,{j,1,Nm},{k,1,Nm}];
    C1[[Nm/2,Nm/2]]=1;
    C2=C1;
    Do[Do[C2[[j,k]]=C1[[j-1,k]]+C1[[j+1,k]]+C1[[j,k-1]]+C1[[j,k+1]]+C1[[j,k]],{j,2,Nm-1},{k,2,Nm-1}];Print[n," ",C2[[Nm/2,Nm/2]]];
    C1=C2,{n,1,20}] (* Yuriy Sibirmovsky, Sep 17 2016 *)
  • PARI
    a(n) = sum(k=0, n, binomial(n, 2*k)*binomial(2*k,k)^2); \\ Michel Marcus, Jun 25 2014
    
  • PARI
    {a(n)=polcoeff(1/agm(1+3*x, 1-5*x +x*O(x^n)), n)}
    for(n=0, 20, print1(a(n), ", ")) \\ Paul D. Hanna, Aug 31 2014
    
  • PARI
    {a(n) = polcoef(polcoef((1+x+y+1/x+1/y)^n, 0), 0)} \\ Seiichi Manyama, Oct 26 2019

Formula

Empirical: n^2*a(n) = (3*n^2-3*n+1)*a(n-1) + 13*(n-1)^2*a(n-2) - 15*(n-2)*(n-1)*a(n-3). - Vaclav Kotesovec, Oct 19 2012
a(n) appears to be the constant term of (1 + X + 1/X + Y + 1/Y)^n, which has o.g.f. hypergeom([1/2, 1/2],[1],16*x^2/(1-x)^2)/(1-x). - Mark van Hoeij, May 07 2013
From Pierre-Louis Giscard, Jun 25 2014 : (Start)
a(n) is exactly the constant term of (1 + X + 1/X + Y + 1/Y)^n since this generates closed walks on the square lattice with self-loops. Non-constant terms generate walks to the neighbors of a vertex. Removing the 1 is equivalent to removing the self-loops.
a(n) = 3F2([1/2, 1/2 - n/2, -n/2], [1, 1], 16).
a(n) = Sum_{k=0..n} C(n,2k)*C(2k,k)^2.
O.g.f.: 2F1([1/2, 1/2], [1], 16*x^2/(1-x)^2)/(1-x) with 2F1 the Hypergeometric function.
E.g.f.: e^x I_{0}(2x)^2 with I_a(x) the modified Bessel function I of the first kind. (End)
O.g.f.: 1 / AGM(1+3*x, 1-5*x), given a(0)=1, where AGM(x,y) = AGM((x+y)/2,sqrt(x*y)) is the arithmetic-geometric mean. - Paul D. Hanna, Aug 31 2014
a(n) ~ 5^(n+1)/(4*Pi*n). - Vaclav Kotesovec, Oct 03 2016

Extensions

a(0)=1 prepended by Seiichi Manyama, Dec 02 2016

A109187 Triangle read by rows: T(n,k) is number of Grand Motzkin paths of length n having k (1,0)-steps.

Original entry on oeis.org

1, 0, 1, 2, 0, 1, 0, 6, 0, 1, 6, 0, 12, 0, 1, 0, 30, 0, 20, 0, 1, 20, 0, 90, 0, 30, 0, 1, 0, 140, 0, 210, 0, 42, 0, 1, 70, 0, 560, 0, 420, 0, 56, 0, 1, 0, 630, 0, 1680, 0, 756, 0, 72, 0, 1, 252, 0, 3150, 0, 4200, 0, 1260, 0, 90, 0, 1, 0, 2772, 0, 11550, 0, 9240, 0, 1980, 0, 110, 0, 1
Offset: 0

Views

Author

Emeric Deutsch, Jun 21 2005

Keywords

Comments

A Grand Motzkin path is a path in the half-plane x >= 0, starting at (0,0), ending at (n,0) and consisting of steps u=(1,1), d=(1,-1) and h=(1,0).
From Peter Bala, Feb 11 2017: (Start)
Consider an infinite 1-dimensional integer lattice with an oriented self-loop at each vertex. Then T(n,k) equals the number of walks of length n from a vertex to itself having k loops. There is a bijection between such walks and Grand Motzkin paths which takes a right step and a left step on the lattice to an up step U and a down step D of a Grand Motzkin path respectively, and takes traversing a loop on the lattice to the horizontal step H. See A282252 for the corresponding triangle of walks on a 2-dimensional lattice with self-loops. (End)

Examples

			T(3,1)=6 because we have hud,hdu,udh,duh,uhd,dhu, where u=(1,1),d=(1,-1), h=(1,0).
Triangle begins:
n\k   [0]  [1]   [2]   [3]   [4]   [5]   [6]  [7]  [8]  [9] [10]
[0]    1;
[1]    0,   1;
[2]    2,   0,    1;
[3]    0,   6,    0,    1;
[4]    6,   0,   12,    0,    1;
[5]    0,  30,    0,   20,    0,    1;
[6]   20,   0,   90,    0,   30,    0,    1;
[7]    0, 140,    0,  210,    0,   42,    0,   1;
[8]   70,   0,  560,    0,  420,    0,   56,   0,   1;
[9]    0, 630,    0, 1680,    0,  756,    0,  72,   0,   1;
[10] 252,   0, 3150,    0, 4200,    0, 1260,   0,  90,   0,   1;
[11] ...
From _Peter Bala_, Feb 11 2017: (Start)
The infinitesimal generator begins
      0
      0    0
      2    0     0
      0    6     0     0
     -6    0    12     0     0
      0  -30     0    20     0   0
     80    0   -90     0    30   0   0
      0  560     0  -210     0  42   0  0
  -2310    0  2240     0  -420   0  56  0  0
  ....
and equals the generalized exponential Riordan array [log(Bessel_I(0,2x)),x], and so has integer entries. (End)
		

Crossrefs

Diagonal of rational function R(x, y, t) = 1/(1 - (x^2 + t*x*y + y^2)) with respect to x,y, i.e., T(n,k) = [(xy)^n*t^k] R(x,y,t). For t=0..7 we have the diagonals: A126869(t=0, column 0), A002426(t=1, row sums), A000984(t=2), A026375(t=3), A081671(t=4), A098409(t=5), A098410(t=6), A104454(t=7).

Programs

  • Maple
    G:=1/sqrt((1-t*z)^2-4*z^2):Gser:=simplify(series(G,z=0,15)): P[0]:=1: for n from 1 to 13 do P[n]:=coeff(Gser,z^n) od: for n from 0 to 13 do seq(coeff(t*P[n],t^k),k=1..n+1) od;
    with(PolynomialTools): CL := p -> CoefficientList(simplify(p), x):
    C := (n,x) -> binomial(2*n,n)*hypergeom([-n,-n],[-n+1/2],1/2-x/4):
    seq(print(CL(C(n,x))), n=0..11); # Peter Luschny, Jan 23 2018
  • Mathematica
    p[0] := 1; p[n_] := GegenbauerC[n, -n , -x/2];
    Flatten[Table[CoefficientList[p[n], x], {n, 0, 11}]] (* Peter Luschny, Jan 23 2018 *)
  • PARI
    T(n,k) = if ((n-k)%2, 0, binomial(n,k)*binomial(n-k, (n-k)/2));
    concat(vector(12, n, vector(n, k, T(n-1, k-1)))) \\ Gheorghe Coserea, Sep 06 2018

Formula

G.f.: 1/sqrt((1-tz)^2-4z^2).
Row sums yield the central trinomial coefficients (A002426).
T(2n+1, 0) = 0.
T(2n, 0) = binomial(2n,n) (A000984).
Sum_{k=0..n} k*T(n,k) = A109188(n).
Except for the order, same rows as those of A105868.
Column k has e.g.f. (x^k/k!)*Bessel_I(0,2x). - Paul Barry, Mar 11 2006
T(n,k) = binomial((n+k)/2,k)*binomial(n,(n+k)/2)*(1+(-1)^(n-k))/2. - Paul Barry, Sep 18 2007
Coefficient array of the polynomials P(n,x) = x^n*hypergeom([1/2-n/2,-n/2], [1], 4/x^2). - Paul Barry, Oct 04 2008
G.f.: 1/(1-xy-2x^2/(1-xy-x^2/(1-xy-x^2/(1-xy-x^2/(1-.... (continued fraction). - Paul Barry, Jan 28 2009
From Paul Barry, Apr 21 2010: (Start)
Exponential Riordan array [Bessel_I(0,2x), x].
Coefficient array of the polynomials P(n,x) = Sum_{k=0..floor(n/2)} C(n,2k)*C(2k, k)*x^(n - 2k).
Diagonal sums are the aerated central Delannoy numbers (A001850 with interpolated zeros). (End)
From Peter Bala, Feb 11 2017: (Start)
T(n,k) = binomial(n,k)*binomial(n-k,floor((n-k)/2))*(1 + (-1)^(n-k))/2.
T(n,k) = (n/k) * T(n-1,k-1).
T(n,k) = the coefficient of H^k in the expansion of (H + U + 1/U)^n.
n-th row polynomial R(n,t) = Sum_{k = 0..floor(n/2)} binomial(n,2*k) * binomial(2*k,k) * t^(n-2*k) = coefficient of x^n in the expansion of (1 + t*x + x^2)^n.
R(n,t) = Sum_{k = 0..n} binomial(n,k)*binomial(2*k,k)*(t - 2)^(n-k).
d/dt(R(n,t)) = n*R(n-1,t).
R(n,t) = (1/Pi) * Integral_{x = 0..Pi} (t + 2*cos(x))^n dx.
Moment representation on a finite interval: R(n,t) = 1/Pi * Integral_{x = t-2 .. t+2} x^n/sqrt((t + 2 - x)*(x - t + 2)) dx.
Recurrence: n*R(n,t) = t*(2*n - 1)*R(n-1,t) - (t^2 - 4)*(n - 1)*R(n-2,t) with R(0,t) = 1 and R(1,t) = t.
R(n,t) = A002426 (t = 1), A000984 (t = 2), A026375 (t = 3), A081671 (t = 4), A098409 (t = 5), A098410 (t = 6) and A104454(t = 7).
The zeros of the row polynomials appear to lie on the imaginary axis in the complex plane. Also, the zeros of R(n,t) and R(n+1,t) appear to interlace on the imaginary axis.
The polynomials R(n,1 + t) are the row polynomials of A171128. (End)
From Peter Luschny, Jan 23 2018: (Start)
These are the coefficients of the polynomials G(n, -n , -x/2) where G(n, a, x) denotes the n-th Gegenbauer polynomial.
These polynomials can also be expressed as C(n, x) = binomial(2*n,n)*hypergeom([-n, -n], [-n+1/2], 1/2-x/4). (End)
Showing 1-2 of 2 results.