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-6 of 6 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)

A112466 Riordan array ((1+2*x)/(1+x), x/(1+x)).

Original entry on oeis.org

1, 1, 1, -1, 0, 1, 1, -1, -1, 1, -1, 2, 0, -2, 1, 1, -3, 2, 2, -3, 1, -1, 4, -5, 0, 5, -4, 1, 1, -5, 9, -5, -5, 9, -5, 1, -1, 6, -14, 14, 0, -14, 14, -6, 1, 1, -7, 20, -28, 14, 14, -28, 20, -7, 1, -1, 8, -27, 48, -42, 0, 42, -48, 27, -8, 1, 1, -9, 35, -75, 90, -42, -42, 90, -75, 35, -9, 1, -1, 10, -44, 110, -165, 132, 0, -132, 165, -110, 44, -10, 1
Offset: 0

Views

Author

Paul Barry, Sep 06 2005

Keywords

Comments

Inverse is A112465.
Triangle T(n,k), 0 <= k <= n, read by rows, given by [1, -2, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...] DELTA [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...] where DELTA is the operator defined in A084938. - Philippe Deléham, Aug 07 2006; corrected by Philippe Deléham, Dec 11 2008
Equals A097808 when the first column is removed. - Georg Fischer, Jul 26 2023

Examples

			Triangle starts
   1;
   1,  1;
  -1,  0,  1;
   1, -1, -1,  1;
  -1,  2,  0, -2,  1;
   1, -3,  2,  2, -3,  1;
  -1,  4, -5,  0,  5, -4,  1;
From _Paul Barry_, Apr 08 2011: (Start)
Production matrix begins
   1,  1;
  -2, -1,  1;
   2,  0, -1,  1;
  -2,  0,  0, -1,  1;
   2,  0,  0,  0, -1,  1;
  -2,  0,  0,  0,  0, -1,  1;
   2,  0,  0,  0,  0,  0, -1,  1; (End)
		

Crossrefs

Columns: A248157(n+2) (k=1), (-1)^n*A080956(n-2) (k=2), (-1)^(n-1)*A254749(n-2) (k=3).

Programs

  • Magma
    A112466:= func< n,k | n eq 0 select 1 else (-1)^(n+k)*(Binomial(n,k) - 2*Binomial(n-1,k)) >;
    [A112466(n,k): k in [0..n], n in [0..12]]; // G. C. Greubel, Apr 30 2025
    
  • Maple
    seq(seq( (-1)^(n-k)*(2*binomial(n-1, k-1)-binomial(n, k)), k=0..n), n=0..10); # G. C. Greubel, Feb 19 2020
  • Mathematica
    {1}~Join~Table[(Binomial[n, n - k] - 2 Binomial[n - 1, n - k - 1])*(-1)^(n - k), {n, 12}, {k, 0, n}] // Flatten (* Michael De Vlieger, Feb 18 2020 *)
  • PARI
    T(n,k) = (-1)^(n-k)*(binomial(n, n-k) - 2*binomial(n-1, n-k-1)); \\ Michel Marcus, Feb 19 2020
    
  • SageMath
    def A112466(n,k): return 1 if (n==0) else (-1)^(n+k)*(binomial(n,k) - 2*binomial(n-1,k))
    print(flatten([[A112466(n,k) for k in range(n+1)] for n in range(13)])) # G. C. Greubel, Apr 30 2025

Formula

Number triangle: T(n,k) = (-1)^(n-k)*(C(n, n-k) - 2*C(n-1, n-k-1)), with T(0,0) = 1.
T(2*n, n) = 0 (main diagonal).
Sum_{k=0..n} T(n, k) = 0 + [n=0] + 2*[n=1] (row sums).
Sum_{k=0..floor(n/2)} T(n-k, k) = (-1)^(n+1)*Fibonacci(n-2) (diagonal sums).
Sum_{k=0..n} T(n,k)*x^k = (x+1)*(x-1)^(n-1), for n >= 1. - Philippe Deléham, Oct 03 2005
T(0,0) = T(1,0) = T(1,1) = 1, T(n,k) = 0 if n < 0 or if n < k, T(n,k) = T(n-1,k-1) - T(n-1,k) for n > 1. - Philippe Deléham, Nov 26 2006
G.f.: (1+2*x)/(1+x-x*y). - R. J. Mathar, Aug 11 2015
From G. C. Greubel, Apr 30 2025: (Start)
T(2*n+1, 2*n+1-k) = T(2*n+1, k) (symmetric odd n rows).
T(2*n, 2*n-k) = (-1)*T(2*n, k) (antisymmetric even n rows).
Sum_{k=0..n} (-1)^k*T(n, k) = A000007(n) (signed row sums).
Sum_{k=0..floor(n/2)} (-1)^k*T(n-k, k) = (-1)^n*A057079(n+2) (signed diagonal sums). (End)

A248158 Expansion of (1 - 2*x^2)/(1 + x)^3. Second column of Riordan triangle A248156.

Original entry on oeis.org

1, -3, 4, -4, 3, -1, -2, 6, -11, 17, -24, 32, -41, 51, -62, 74, -87, 101, -116, 132, -149, 167, -186, 206, -227, 249, -272, 296, -321, 347, -374, 402, -431, 461, -492, 524, -557, 591, -626, 662, -699, 737, -776, 816, -857, 899, -942, 986
Offset: 0

Views

Author

Wolfdieter Lang, Oct 05 2014

Keywords

Comments

This is the column k=1 sequence of the Riordan triangle A248156 without a leading zero.

Crossrefs

Cf. A046691, A148157, A248156(n+1,1).

Programs

  • Magma
    [(-1)^n*(2+5*n-n^2)/2: n in [0..60]]; // G. C. Greubel, May 30 2025
    
  • Mathematica
    Table[(-1)^n*(2+5*n-n^2)/2, {n,0,60}] (* G. C. Greubel, May 30 2025 *)
  • Python
    def A248158(n): return (-1)**n*(2+5*n-n**2)//2
    print([A248158(n) for n in range(51)]) # G. C. Greubel, May 30 2025

Formula

O.g.f.: (1 - 2*x^2)/(1 + x)^3 = -2/(1 + x) + 4/(1 + x)^2 - 1/(1 + x)^3.
a(n) = (-1)^n*(4*(2*n+1) - (n+1)*(n+2))/2, n >= 0.
a(n) = -3*(a(n-1) + a(n-2)) - a(n-3), n >= 3 with a(0) = 1, a(1) = -3 and a(2) = 4.
From R. J. Mathar, Mar 13 2021: (Start)
a(n) = (-1)^(n+1)*A046691(n-5).
a(n) + a(n+1) = A248157(n+1). (End)
E.g.f.: (1/2)*(2 - 4*x - x^2)*exp(-x). - G. C. Greubel, May 30 2025

A248159 Expansion of (1 - 2*x^2)/(1 + x)^4. Third column of Riordan triangle A248156.

Original entry on oeis.org

1, -4, 8, -12, 15, -16, 14, -8, -3, 20, -44, 76, -117, 168, -230, 304, -391, 492, -608, 740, -889, 1056, -1242, 1448, -1675, 1924, -2196, 2492, -2813, 3160, -3534, 3936, -4367, 4828, -5320, 5844, -6401, 6992, -7618, 8280, -8979, 9716
Offset: 0

Views

Author

Wolfdieter Lang, Oct 07 2014

Keywords

Comments

This is the column k=2 sequence of the Riordan triangle A248156 without the leading two zeros.

Crossrefs

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

Programs

Formula

O.g.f.: (1 - 2*x^2)/(1 + x)^4 = -1/(1 + x)^4 + 4/(1 + x)^3 -2/(1 + x)^2.
a(n) = (-1)^n*(n+1)*(6 + 7*n - n^2)/3!, n >= 0.
a(n) = -4*(a(n-1) + a(n-3)) - 6*a(n-2) - a(n-4), n >= 4, with a(0) =1, a(1) = -4, a(2) = 8 and a(3) = -12.
a(n) + a(n+1) = A248158(n+1). - R. J. Mathar, Mar 13 2021
E.g.f.: (1/6)*(6 - 18*x + 3*x^2 + x^3)*exp(-x). - G. C. Greubel, May 30 2025

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

A347171 Triangle read by rows where T(n,k) is the sum of Golay-Rudin-Shapiro terms GRS(j) (A020985) for j in the range 0 <= j < 2^n and having binary weight wt(j) = A000120(j) = k.

Original entry on oeis.org

1, 1, 1, 1, 2, -1, 1, 3, -1, 1, 1, 4, 0, 0, -1, 1, 5, 2, -2, 1, 1, 1, 6, 5, -4, 3, -2, -1, 1, 7, 9, -5, 3, -3, 3, 1, 1, 8, 14, -4, 0, 0, 2, -4, -1, 1, 9, 20, 0, -6, 6, -4, 0, 5, 1, 1, 10, 27, 8, -14, 12, -10, 8, -3, -6, -1, 1, 11, 35, 21, -22, 14, -10, 10, -11, 7, 7, 1
Offset: 0

Views

Author

Kevin Ryde, Aug 21 2021

Keywords

Comments

Doche and Mendès France form polynomials P_n(y) = Sum_{j=0..2^n-1} GRS(j) * y^wt(j) and here row n is the coefficients of P_n starting from the constant term, so P_n(y) = Sum_{k=0..n} T(n,k)*y^k. They conjecture that the number of real roots of P_n is A285869(n).
Row sum n is the sum of GRS terms from j = 0 to 2^n-1 inclusive, which Brillhart and Morton (Beispiel 6 page 129) show is A020986(2^n-1) = 2^ceiling(n/2) = A060546(n). The same follows by substituting y=1 in the P_n recurrence or the generating function.

Examples

			Triangle begins
        k=0 k=1 k=2 k=3 k=4 k=5 k=6 k=7
  n=0:   1
  n=1:   1,  1
  n=2:   1,  2, -1
  n=3:   1,  3, -1,  1
  n=4:   1,  4,  0,  0, -1
  n=5:   1,  5,  2, -2,  1,  1
  n=6:   1,  6,  5, -4,  3, -2, -1
  n=7:   1,  7,  9, -5,  3, -3,  3,  1
For T(5,3), those j in the range 0 <= j < 2^5 with wt(j) = 3 are
  j      =  7 11 13 14 19 21 22 25 26 28
  GRS(j) = +1 -1 -1 +1 -1 +1 -1 -1 -1 +1 total -2 = T(5,3)
		

Crossrefs

Cf. A020985 (GRS), A020986 (GRS partial sums), A000120 (binary weight), A285869.
Columns k=0..3: A000012, A001477, A000096, A275874.
Cf. A165326 (main diagonal), A248157 (second diagonal negated).
Cf. A060546 (row sums), A104969 (row sums squared terms).
Cf. A329301 (antidiagonal sums).
Cf. A104967 (rows reversed, up to signs).

Programs

  • PARI
    my(M=Mod('x, 'x^2-(1-'y)*'x-2*'y)); row(n) = Vecrev(subst(lift(M^n),'x,'y+1));

Formula

T(n,k) = T(n-1,k) - T(n-1,k-1) + 2*T(n-2,k-1) for n>=2, and taking T(n,k)=0 if k<0 or k>n.
T(n,k) = (-1)^k * A104967(n,n-k).
Row polynomial P_n(y) = (1-y)*P_{n-1}(y) + 2*y*P_{n-2}(y) for n>=2. [Doche and Mendès France]
G.f.: (1 + 2*x*y)/(1 + x*(y-1) - 2*x^2*y).
Column g.f.: C_k(x) = 1/(1-x) for k=0 and C_k(x) = x^k * (2*x-1)^(k-1) / (1-x)^(k+1) for k>=1.
Showing 1-6 of 6 results.