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.

A248156 Inverse Riordan triangle of A106513: Riordan ((1 - 2*x^2 )/(1 + x), x/(1+x)).

Original entry on oeis.org

1, -2, 1, 1, -3, 1, 0, 4, -4, 1, -1, -4, 8, -5, 1, 2, 3, -12, 13, -6, 1, -3, -1, 15, -25, 19, -7, 1, 4, -2, -16, 40, -44, 26, -8, 1, -5, 6, 14, -56, 84, -70, 34, -9, 1, 6, -11, -8, 70, -140, 154, -104, 43, -10, 1, -7, 17, -3, -78, 210, -294, 258, -147, 53, -11, 1, 8, -24, 20, 75, -288, 504, -552, 405, -200, 64, -12, 1
Offset: 0

Views

Author

Wolfdieter Lang, Oct 05 2014

Keywords

Comments

Row sums have o.g.f. (1 - 2*x)/(1 + x): [1, -1, repeat(-1, 1)].

Examples

			The triangle T(n,k) begins:
  n\k  0   1   2   3    4    5    6    7    8    9
  0:   1
  1:  -2   1
  2:   1  -3   1
  3:   0   4  -4   1
  4:  -1  -4   8  -5    1
  5:   2   3 -12  13   -6    1
  6:  -3  -1  15 -25   19   -7    1
  7:   4  -2 -16  40  -44   26   -8    1
  8:  -5   6  14 -56   84  -70   34   -9    1
  9:   6 -11  -8  70 -140  154 -104   43  -10    1
  ...
For more rows see the link.
Recurrence from A-sequence: T(5,2) = T(4,1) - T(4,2) = -4 - 8 = -12.
Recurrence from the Z-sequence: T(5,0) = -(2*(-1) + 3*(-4) + 7*8 + 17*(-5) + 41*1) = 2.
Standard recurrence for T(n,0): T(3,0) = -2*T(2,0) - T(1,0) = -2*1 - (-2) = 0.
		

Crossrefs

Columns: A248157 (k=0), A248158 (k=1), A248159 (k=2), A248160 (k=3).
Diagonals: A000012 (k=n), A022958(n+3) (k=n-1), -A034856(n-1) (k=n-2), A000297(n-4) (k=n-3), A014309(n-3) (k=n-4).
Sums: (-1)^n*A001611(n) (diagonal), (-1)^n*A083318(n) (alternating sign row).

Programs

  • Magma
    function T(n,k) // T = A248156
      if k eq n then return 1;
      elif k eq 0 then return (-1)^n*(3-n);
      else return T(n-1,k-1) - T(n-1,k);
      end if;
    end function;
    [T(n,k): k in [0..n], n in [0..12]]; // G. C. Greubel, May 27 2025
    
  • Mathematica
    T[n_, k_] := SeriesCoefficient[x^k*(1 - 2*x^2)/(1 + x)^(k + 2), {x, 0, n}]; Table[T[n, k], {n, 0, 11}, {k, 0, n}] // Flatten (* Jean-François Alcover, Oct 09 2014 *)
    T[n_, k_]:= T[n, k]= If[k==n,1, If[k==0,(-1)^n*(3-n), T[n-1,k-1]-T[n-1,k]]];
    Table[T[n,k], {n,0,25}, {k,0,n}]//Flatten (* G. C. Greubel, May 27 2025 *)
  • SageMath
    def T(n,k): # T = A248156
        if (k==n): return 1
        elif (k==0): return (-1)^n*(3-n)
        else: return T(n-1,k-1) - T(n-1,k)
    print(flatten([[T(n,k) for k in range(n+1)] for n in range(13)])) # G. C. Greubel, May 27 2025

Formula

O.g.f. row polynomials R(n,x) = Sum_{k=0..n} T(n,k)*x^k = [(-z)^n] (1 - 2*z^2)/( (1 + z)*(1 + (1-x)*z)).
O.g.f. column m: x^m*(1 - 2*x^2)/(1 + x)^(m+2), m >= 0.
The A-sequence is [1, -1], implying the recurrence T(n,k) = T(n-1, k-1) - T(n-1, k), n >= k > = 1.
The Z-sequence is -[2, 3, 7, 17, 41, 99, 239, 577, 1393, ...] = A248161, implying the recurrence T(n, 0) = Sum_{k=0..n-1} T(n-1,k)*Z(k). See the W. Lang link under A006232 for Riordan A- and Z-sequences.
The standard recurrence for the sequence for column k=0 is T(0,0) = 1 and T(n,0) = -2*T(n-1,0) - T(n-2,0), n >= 3, with T(1,0) = -2 and T(2,0) = 1.
From G. C. Greubel, May 27 2025: (Start)
Sum_{k=0..n} T(n, k) = (-1)^(n+1) + 2*([n=0] - [n=1]).
Sum_{k=0..floor(n/2)} (-1)^k*T(n-k, k) = the repeated pattern of [1, -2, 0, 3, -4, 2]. (End)

A248160 Expansion of (1 - 2*x^2)/(1 + x)^5. Fourth column of Riordan triangle A248156.

Original entry on oeis.org

1, -5, 13, -25, 40, -56, 70, -78, 75, -55, 11, 65, -182, 350, -580, 884, -1275, 1767, -2375, 3115, -4004, 5060, -6302, 7750, -9425, 11349, -13545, 16037, -18850, 22010, -25544, 29480, -33847, 38675, -43995, 49839, -56240, 63232, -70850, 79130, -88109, 97825, -108317, 119625, -131790
Offset: 0

Views

Author

Wolfdieter Lang, Oct 09 2014

Keywords

Comments

This is column k=3 of the Riordan triangle A248156 without the leading three zeros.

Crossrefs

Cf. A248156 (column k=3).
Cf. A248157 (k=0), A248158 (k=1), A248159 (k=2).

Programs

  • Magma
    [(-1)^n*(n + 1)*(n + 2)*(12 + 9*n - n^2)/24: n in [0..50]]; // G. C. Greubel, May 30 2025
    
  • Maple
    A248160:=n->(-1)^n*(n+1)*(n+2)*(12 + 9*n - n^2)/4!: seq(A248160(n), n=0..30); # Wesley Ivan Hurt, Oct 09 2014
  • Mathematica
    Table[(-1)^n*(n + 1)*(n + 2)*(12 + 9*n - n^2)/4!, {n, 0, 30}] (* Wesley Ivan Hurt, Oct 09 2014 *)
    CoefficientList[Series[(1-2x^2)/(1+x)^5,{x,0,50}],x] (* or *) LinearRecurrence[ {-5,-10,-10,-5,-1},{1,-5,13,-25,40},50] (* Harvey P. Dale, Apr 13 2019 *)
  • PARI
    Vec((1 - 2*x^2)/(1 + x)^5 + O(x^50)) \\ Michel Marcus, Oct 09 2014
    
  • Python
    def A248160(n): return (-1)**n*(n+1)*(n+2)*(12+9*n-n**2)//24 # G. C. Greubel, May 30 2025

Formula

O.g.f.: (1 - 2*x^2)/(1 + x)^5 = -2/(1 + x)^3 + 4/(1 + x)^4 - 1/(1 + x)^5.
a(n) = (-1)^n*(n+1)*(n+2)*(12 + 9*n - n^2)/4!.
a(n) = -5*(a(n-1) + a(n-4)) - 10*(a(n-2) + a(n-3)) - a(n-5), n >= 5, with a(0) =1, a(1) = -5, a(2) = 13, a(3) = -25 and a(4) = 40.
E.g.f.: (1/4!)*(24 - 96*x + 48*x^2 - x^4)*exp(-x). - G. C. Greubel, May 30 2025
Showing 1-2 of 2 results.