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.

A186925 Coefficient of x^n in (1+n*x+x^2)^n.

Original entry on oeis.org

1, 1, 6, 45, 454, 5775, 88796, 1602447, 33213510, 777665691, 20302315252, 584774029983, 18422140045596, 630132567760345, 23257790717110392, 921362075184792825, 38994274473840538182, 1755943506127367745795, 83829045032101462204100, 4229207755493569286374167
Offset: 0

Views

Author

Emanuele Munarini, Mar 02 2011

Keywords

Crossrefs

Main diagonal of A292627.

Programs

  • Magma
    P:=PolynomialRing(Integers()); [ Coefficients((1+n*x+x^2)^n)[n+1]: n in [0..22] ]; // Klaus Brockhaus, Mar 02 2011
    
  • Mathematica
    Flatten[{1,Table[Sum[Binomial[n, k]*Binomial[n-k, n-2*k]*n^(n-2*k), {k,0,Floor[n/2]}],{n,1,20}]}] (* Vaclav Kotesovec, Apr 17 2014 *)
    Table[GegenbauerC[n, -n, -n/2] + KroneckerDelta[n, 0], {n, 0, 100}] (* Emanuele Munarini, Oct 20 2016 *)
    Table[SeriesCoefficient[(1 + n*x + x^2)^n, {x, 0, n}], {n, 0, 20}] (* Vaclav Kotesovec, Feb 13 2023 *)
  • Maxima
    a(n):=coeff(expand((1+n*x+x^2)^n),x,n);
    
  • Maxima
    makelist(ultraspherical(n,-n,-n/2),n,0,12); /* Emanuele Munarini, Oct 20 2016 */
    makelist(a(n),n,0,20);
    
  • PARI
    {a(n) = sum(k=0, n, (n-2)^(n-k)*binomial(n, k)*binomial(2*k, k))} \\ Seiichi Manyama, May 01 2019
    
  • PARI
    a(n) = polcoef((1+n*x+x^2)^n, n); \\ Michel Marcus, May 01 2019

Formula

a(n) = [x^n] (1+n*x+x^2)^n.
a(n) = Sum_{k=0..floor(n/2)} binomial(n, k)*binomial(n-k, n-2*k)*n^(n-2*k).
a(n) ~ BesselI(0,2) * n^n. - Vaclav Kotesovec, Apr 17 2014
a(n) = GegenbauerPoly(n,-n,-n/2). - Emanuele Munarini, Oct 20 2016
From Ilya Gutkovskiy, Sep 20 2017: (Start)
a(n) = [x^n] 1/sqrt((1 + 2*x - n*x)*(1 - 2*x - n*x)).
a(n) = n! * [x^n] exp(n*x)*BesselI(0,2*x). (End)
From Seiichi Manyama, May 01 2019: (Start)
a(n) = Sum_{k=0..n} (n-2)^(n-k) * binomial(n,k) * binomial(2*k,k).
a(n) = Sum_{k=0..n} (n+2)^(n-k) * (-1)^k * binomial(n,k) * binomial(2*k,k). (End)
a(n) = (1/4)^n * Sum_{k=0..n} (n-2)^k * (n+2)^(n-k) * binomial(2*k,k) * binomial(2*(n-k),n-k). - Seiichi Manyama, Aug 18 2025