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.

A136487 Coefficients of polynomial recursion p(n,x) = (x-1)*(p(n-1,x) - (x+1)*p(n-2,x)), p(0,x) = 1, p(1,x) = x+1.

Original entry on oeis.org

1, 1, 1, 1, 1, -1, -1, -1, 0, 2, 0, -1, 2, 0, -4, 0, 2, -3, 2, 7, -4, -5, 2, 1, 5, -5, -11, 11, 7, -7, -1, 1, -8, 12, 16, -28, -8, 20, 0, -4, 13, -25, -20, 60, -2, -46, 12, 12, -3, -1, -21, 50, 19, -120, 38, 92, -50, -24, 15, 2, -1
Offset: 0

Views

Author

Roger L. Bagula, Mar 21 2008

Keywords

Comments

Only coefficients of x^k for k <= degree of p(n,x) are included. With this then, since p(2,x) = 0, row 2 is empty.
The same polynomial coefficients may be obtained, without signs, with the use of the recurrence p(x, n) = (x+1)*p(x, n-1) - (x^2-1)*p(x, n-2), and p(x, 0) = 1, p(x, 1) = x-1.

Examples

			First few rows are:
    1;
    1,   1;
   {};
    1,   1,  -1,   -1;
   -1,   0,   2,    0, -1;
    2,   0,  -4,    0,  2;
   -3,   2,   7,   -4, -5,   2,   1;
    5,  -5, -11,   11,  7,  -7,  -1,   1;
   -8,  12,  16,  -28, -8,  20,   0,  -4;
   13, -25, -20,   60, -2, -46,  12,  12, -3, -1;
  -21,  50,  19, -120, 38,  92, -50, -24, 15,  2, -1;
		

Crossrefs

Cf. A000045, A130706 (row sums).

Programs

  • Magma
    m:=12;
    function p(n,x)
      if n le 1 then return (x+1)^n;
      else return (x-1)*(p(n-1,x) - (x+1)*p(n-2,x));  end if;
    end function;
    R:=PowerSeriesRing(Integers(), m+2);
    T:= func< n,k | Coefficient(R!( p(n,x) ), k) >;
    [1,1,1] cat [T(n,k): k in [0..n], n in [3..m]]; // G. C. Greubel, Jul 31 2023
    
  • Maple
    F:= proc(n) option remember; expand((1-x)*procname(n-1)+(1-x^2)*procname(n-2)) end proc:
    F(0):= 1: F(1):= 1+x:
    R:=proc(n) local V,j;
     V:= F(n);
     seq(coeff(V,x,j),j=0..degree(V))
    end proc:
    for i from 0 to 20 do R(i) od; # Robert Israel, Dec 03 2018
  • Mathematica
    P[x,0]= 1; P[x,1]= x+1; P[x_,n_]:= P[x,n]= (x-1)*(P[x,n-1] - (x+1)*P[x,n-2]);
    Table[CoefficientList[P[x,n],x],{n,0,10}]//Flatten
  • SageMath
    def p(n,x):
        if n<2: return (x+1)^n
        else: return (x-1)*(p(n-1,x) - (x+1)*p(n-2,x))
    def T(n):
        P. = PowerSeriesRing(QQ)
        return P( p(n,x) ).list()
    flatten([T(n) for n in range(13)]) # G. C. Greubel, Jul 31 2023

Formula

T(n, k) = coefficient [x^k] ( p(x, n) ), where p(x,n) = (x-1)*p(x,n-1) - (x^2-1)*p(x,n-2), p(x,0) = 1, p(x,1) = x+1.
Sum_{k >= 0} T(n, k) = A130706(n).
From Robert Israel, Dec 03 2018: (Start)
T(n,k) = T(n-1,k-1) - T(n-1,k) - T(n-2,k-2) + T(n-2,k).
G.f. as array: (1-2*x)/(1 + x*(y-1)+x^2*(1-y^2)).
T(n,0) = (-1)^(n+1)*A000045(n-2) for n >= 3. (End)

Extensions

Edited by Robert Israel, Dec 03 2018