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.

A259875 Irregular triangle read by rows: coefficients (highest degree first) of polynomials defined by p_0(x)=0, p_1(x)=p_2(x)=1, p_3(x)=x+1; p_n(x)=x*p_{n-2}(x)-p_{n-4}(x).

Original entry on oeis.org

0, 1, 1, 1, 1, 1, 0, 1, 1, -1, 1, 0, -1, 1, 1, -2, -1, 1, 0, -2, 0, 1, 1, -3, -2, 1, 1, 0, -3, 0, 1, 1, 1, -4, -3, 3, 1, 1, 0, -4, 0, 3, 0, 1, 1, -5, -4, 6, 3, -1, 1, 0, -5, 0, 6, 0, -1, 1, 1, -6, -5, 10, 6, -4, -1, 1, 0, -6, 0, 10, 0, -4, 0, 1, 1, -7, -6, 15, 10, -10, -4, 1
Offset: 0

Views

Author

N. J. A. Sloane, Jul 09 2015

Keywords

Examples

			Triangle begins:
0;
1;
1;
1, 1;
1, 0;
1, 1, -1;
1, 0, -1;
1, 1, -2, -1;
1, 0, -2,  0;
1, 1, -3, -2, 1;
1, 0, -3,  0, 1;
1, 1, -4, -3, 3, 1;
1, 0, -4,  0, 3, 0;
...
		

Crossrefs

p_n(3) gives A005013.

Programs

  • Maple
    p:= proc(n) option remember; expand(`if`(n=0, 0,
         `if`(n<3, 1, `if`(n=3, x+1, x*p(n-2)-p(n-4)))))
        end:
    T:= n-> `if`(n=0, 0, (s-> seq(coeff(s, x, degree(s)-i)
            , i=0..degree(s)))(p(n))):
    seq(T(n), n=0..20);  # Alois P. Heinz, Jul 10 2015
  • Mathematica
    p[0] = 0&; p[1] = p[2] = 1&; p[3] = #+1&; p[n_][x_] := p[n, x] = x*p[n-2][x] - p[n-4][x];
    row[0] = {0}; row[n_] := CoefficientList[p[n][x], x] // Reverse;
    Table[row[n], {n, 0, 20}] // Flatten (* Jean-François Alcover, Jun 12 2018 *)

Extensions

More terms from Alois P. Heinz, Jul 10 2015