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.

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