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-4 of 4 results.

A059259 Triangle read by rows giving coefficient T(i,j) of x^i y^j in 1/(1-x-x*y-y^2) = 1/((1+y)(1-x-y)) for (i,j) = (0,0), (1,0), (0,1), (2,0), (1,1), (0,2), ...

Original entry on oeis.org

1, 1, 0, 1, 1, 1, 1, 2, 2, 0, 1, 3, 4, 2, 1, 1, 4, 7, 6, 3, 0, 1, 5, 11, 13, 9, 3, 1, 1, 6, 16, 24, 22, 12, 4, 0, 1, 7, 22, 40, 46, 34, 16, 4, 1, 1, 8, 29, 62, 86, 80, 50, 20, 5, 0, 1, 9, 37, 91, 148, 166, 130, 70, 25, 5, 1, 1, 10, 46, 128, 239, 314, 296, 200
Offset: 0

Views

Author

N. J. A. Sloane, Jan 23 2001

Keywords

Comments

This sequence provides the general solution to the recurrence a(n) = a(n-1) + k*(k+1)*a(n-2), a(0)=a(1)=1. The solution is (1, 1, k^2 + k + 1, 2*k^2 + 2*k + 1, ...) whose coefficients can be read from the rows of the triangle. The row sums of the triangle are given by the case k=1. These are the Jacobsthal numbers, A001045. Viewed as a square array, its first row is (1,0,1,0,1,...) with e.g.f. cosh(x), g.f. 1/(1-x^2) and subsequent rows are successive partial sums given by 1/((1-x)^n * (1-x^2)). - Paul Barry, Mar 17 2003
Conjecture: every second column of this triangle is identical to a column in the square array A071921. For example, column 4 of A059259 (1, 3, 9, 22, 46, ...) appears to be the same as column 3 of A071921; column 6 of A059259 (1, 4, 16, 50, 130, 296, ...) appears to be the same as column 4 of A071921; and in general column 2k of A059259 appears to be the same as column k+1 of A071921. Furthermore, since A225010 is a transposition of A071921 (ignoring the latter's top row and two leftmost columns), there appears to be a correspondence between column 2k of A059259 and row k of A225010. - Mathew Englander, May 17 2014
T(n,k) is the number of n-tilings of a (one-dimensional) board that use k (1,1)-fence tiles and n-k squares. A (1,1)-fence is a tile composed of two pieces of width 1 separated by a gap of width 1. - Michael A. Allen, Jun 25 2020
See the Edwards-Allen 2020 paper, page 14, for proof of Englander's conjecture. - Michael De Vlieger, Dec 10 2020

Examples

			Triangle begins:
  1;
  1,  0;
  1,  1,  1;
  1,  2,  2,   0;
  1,  3,  4,   2,   1;
  1,  4,  7,   6,   3,   0;
  1,  5, 11,  13,   9,   3,   1;
  1,  6, 16,  24,  22,  12,   4,   0;
  1,  7, 22,  40,  46,  34,  16,   4,  1;
  1,  8, 29,  62,  86,  80,  50,  20,  5,  0;
  1,  9, 37,  91, 148, 166, 130,  70, 25,  5, 1;
  1, 10, 46, 128, 239, 314, 296, 200, 95, 30, 6, 0;
...
		

Crossrefs

See A059260 for an explicit formula.
Diagonals of this triangle are given by A006498.
Similar to the triangles A035317, A080242, A108561, A112555.

Programs

  • Maple
    read transforms; 1/(1-x-x*y-y^2); SERIES2(%,x,y,12); SERIES2TOLIST(%,x,y,12);
  • Mathematica
    T[n_, 0]:= 1; T[n_, n_]:= (1+(-1)^n)/2; T[n_, k_]:= T[n, k] = T[n-1, k] + T[n-1, k-1]; Table[T[n, k], {n, 0, 10} , {k, 0, n}]//Flatten (* G. C. Greubel, Jan 03 2017 *)
  • PARI
    {T(n,k) = if(k==0, 1, if(k==n, (1+(-1)^n)/2, T(n-1,k) +T(n-1,k-1)) )};
    for(n=0,10, for(k=0,n, print1(T(n,k), ", "))) \\ G. C. Greubel, Apr 29 2019
  • Sage
    def A059259_row(n):
        @cached_function
        def prec(n, k):
            if k==n: return (-1)^n
            if k==0: return 0
            return prec(n-1,k-1)-sum(prec(n,k+i-1) for i in (2..n-k+1))
        return [(-1)^(n-k+1)*prec(n+1, k) for k in (1..n)]
    for n in (1..12): print(A059259_row(n)) # Peter Luschny, Mar 16 2016
    

Formula

G.f.: 1/(1 - x - x*y - y^2).
As a square array read by antidiagonals, this is T(n, k) = Sum_{i=0..n} (-1)^(n-i)*C(i+k, k). - Paul Barry, Jul 01 2003
T(2*n,n) = A026641(n). - Philippe Deléham, Mar 08 2007
T(n,k) = T(n-1,k) + T(n-2,k-1) + T(n-2,k-2), T(0,0) = T(1,0) = T(2,0) = T(2,1) = T(2,2)=1, T(1,1)=0, T(n,k)=0 if k < 0 or if k > n. - Philippe Deléham, Nov 24 2013
T(n,0) = 1, T(n,n) = (1+(-1)^n)/2, and T(n,k) = T(n-1,k) + T(n-1,k-1) for 0 < k < n. - Mathew Englander, May 24 2014
From Michael A. Allen, Jun 25 2020: (Start)
T(n,k) + T(n-1,k-1) = binomial(n,k) if n >= k > 0.
T(2*n-1,2*n-2) = T(2*n,2*n-1) = n, T(2*n,2*n-2) = n^2, T(2*n+1,2*n-1) = n*(n+1) for n > 0.
T(n,2) = binomial(n-2,2) + n - 1 for n > 1 and T(n,3) = binomial(n-3,3) + 2*binomial(n-2,2) for n > 2.
T(2*n-k,k) = A123521(n,k). (End)

A035317 Pascal-like triangle associated with A000670.

Original entry on oeis.org

1, 1, 1, 1, 2, 2, 1, 3, 4, 2, 1, 4, 7, 6, 3, 1, 5, 11, 13, 9, 3, 1, 6, 16, 24, 22, 12, 4, 1, 7, 22, 40, 46, 34, 16, 4, 1, 8, 29, 62, 86, 80, 50, 20, 5, 1, 9, 37, 91, 148, 166, 130, 70, 25, 5, 1, 10, 46, 128, 239, 314, 296, 200, 95, 30, 6, 1, 11, 56, 174, 367, 553, 610, 496, 295, 125
Offset: 0

Views

Author

Keywords

Comments

From Johannes W. Meijer, Jul 20 2011: (Start)
The triangle sums, see A180662 for their definitions, link this "Races with Ties" triangle with several sequences, see the crossrefs. Observe that the Kn4 sums lead to the golden rectangle numbers A001654 and that the Fi1 and Fi2 sums lead to the Jacobsthal sequence A001045.
The series expansion of G(x, y) = 1/((y*x-1)*(y*x+1)*((y+1)*x-1)) as function of x leads to this sequence, see the second Maple program. (End)
T(2n,k) = the number of hatted frog arrangements with k frogs on the 2xn grid. See the linked paper "Frogs, hats and common subsequences". - Chris Cox, Apr 12 2024

Examples

			Triangle begins:
  1;
  1,  1;
  1,  2,  2;
  1,  3,  4,   2;
  1,  4,  7,   6,   3;
  1,  5, 11,  13,   9,   3;
  1,  6, 16,  24,  22,  12,   4;
  1,  7, 22,  40,  46,  34,  16,   4;
  1,  8, 29,  62,  86,  80,  50,  20,  5;
  1,  9, 37,  91, 148, 166, 130,  70, 25,  5;
  1, 10, 46, 128, 239, 314, 296, 200, 95, 30, 6;
  ...
		

Crossrefs

Row sums are A000975, diagonal sums are A080239.
Central terms are A014300.
Similar to the triangles A059259, A080242, A108561, A112555.
Cf. A059260.
Triangle sums (see the comments): A000975 (Row1), A059841 (Row2), A080239 (Kn11), A052952 (Kn21), A129696 (Kn22), A001906 (Kn3), A001654 (Kn4), A001045 (Fi1, Fi2), A023435 (Ca2), Gi2 (A193146), A190525 (Ze2), A193147 (Ze3), A181532 (Ze4). - Johannes W. Meijer, Jul 20 2011
Cf. A181971.

Programs

  • Haskell
    a035317 n k = a035317_tabl !! n !! k
    a035317_row n = a035317_tabl !! n
    a035317_tabl = map snd $ iterate f (0, [1]) where
       f (i, row) = (1 - i, zipWith (+) ([0] ++ row) (row ++ [i]))
    -- Reinhard Zumkeller, Jul 09 2012
    
  • Maple
    A035317 := proc(n,k): add((-1)^(i+k) * binomial(i+n-k+1, i), i=0..k) end: seq(seq(A035317(n,k), k=0..n), n=0..10); # Johannes W. Meijer, Jul 20 2011
    A035317 := proc(n,k): coeff(coeftayl(1/((y*x-1)*(y*x+1)*((y+1)*x-1)), x=0, n), y, k) end: seq(seq(A035317(n,k), k=0..n), n=0..10); # Johannes W. Meijer, Jul 20 2011
  • Mathematica
    t[n_, k_] := (-1)^k*(((-1)^k*(n+2)!*Hypergeometric2F1[1, n+3, k+2, -1])/((k+1)!*(n-k+1)!) + 2^(k-n-2)); Flatten[ Table[ t[n, k], {n, 0, 11}, {k, 0, n}]] (* Jean-François Alcover, Dec 14 2011, after Johannes W. Meijer *)
  • PARI
    {T(n,k)=if(n==k,(n+2)\2,if(k==0,1,if(n>k,T(n-1,k-1)+T(n-1,k))))}
    for(n=0,12,for(k=0,n,print1(T(n,k),","));print("")) \\ Paul D. Hanna, Jul 18 2012
    
  • Sage
    def A035317_row(n):
        @cached_function
        def prec(n, k):
            if k==n: return 1
            if k==0: return 0
            return -prec(n-1,k-1)-sum(prec(n,k+i-1) for i in (2..n-k+1))
        return [(-1)^k*prec(n+2, k) for k in (1..n)]
    for n in (1..11): print(A035317_row(n)) # Peter Luschny, Mar 16 2016

Formula

T(n,k) = Sum_{j=0..floor(n/2)} binomial(n-2j, k-2j). - Paul Barry, Feb 11 2003
From Johannes W. Meijer, Jul 20 2011: (Start)
T(n, k) = Sum_{i=0..k}((-1)^(i+k) * binomial(i+n-k+1,i)). (Mendelson)
T(n, k) = T(n-1, k-1) + T(n-1, k) with T(n, 0) = 1 and T(n, n) = floor(n/2) + 1. (Mendelson)
Sum_{k = 0..n}((-1)^k * (n-k+1)^n * T(n, k)) = A000670(n). (Mendelson)
T(n, n-k) = A128176(n, k); T(n+k, n-k) = A158909(n, k); T(2*n-k, k) = A092879(n, k). (End)
T(2*n+1,n) = A014301(n+1); T(2*n+1,n+1) = A026641(n+1). - Reinhard Zumkeller, Jul 19 2012

Extensions

More terms from James Sellers

A108561 Triangle read by rows: T(n,0)=1, T(n,n)=(-1)^n, T(n+1,k)=T(n,k-1)+T(n,k) for 0 < k < n.

Original entry on oeis.org

1, 1, -1, 1, 0, 1, 1, 1, 1, -1, 1, 2, 2, 0, 1, 1, 3, 4, 2, 1, -1, 1, 4, 7, 6, 3, 0, 1, 1, 5, 11, 13, 9, 3, 1, -1, 1, 6, 16, 24, 22, 12, 4, 0, 1, 1, 7, 22, 40, 46, 34, 16, 4, 1, -1, 1, 8, 29, 62, 86, 80, 50, 20, 5, 0, 1, 1, 9, 37, 91, 148, 166, 130, 70, 25, 5, 1, -1, 1, 10, 46, 128, 239, 314, 296, 200, 95, 30, 6, 0, 1, 1, 11, 56, 174, 367
Offset: 0

Views

Author

Reinhard Zumkeller, Jun 10 2005

Keywords

Comments

Sum_{k=0..n} T(n,k) = A078008(n);
Sum_{k=0..n} abs(T(n,k)) = A052953(n-1) for n > 0;
T(n,1) = n - 2 for n > 1;
T(n,2) = A000124(n-3) for n > 2;
T(n,3) = A003600(n-4) for n > 4;
T(n,n-6) = A001753(n-6) for n > 6;
T(n,n-5) = A001752(n-5) for n > 5;
T(n,n-4) = A002623(n-4) for n > 4;
T(n,n-3) = A002620(n-1) for n > 3;
T(n,n-2) = A008619(n-2) for n > 2;
T(n,n-1) = n mod 2 for n > 0;
T(2*n,n) = A072547(n+1).
Sum_{k=0..n} T(n,k)*x^k = A232015(n), A078008(n), A000012(n), A040000(n), A001045(n+2), A140725(n+1) for x = 2, 1, 0, -1, -2, -3 respectively. - Philippe Deléham, Nov 17 2013, Nov 19 2013
(1,a^n) Pascal triangle with a = -1. - Philippe Deléham, Dec 27 2013
T(n,k) = A112465(n,n-k). - Reinhard Zumkeller, Jan 03 2014

Examples

			From _Philippe Deléham_, Nov 17 2013: (Start)
Triangle begins:
  1;
  1, -1;
  1,  0,  1;
  1,  1,  1, -1;
  1,  2,  2,  0,  1;
  1,  3,  4,  2,  1, -1;
  1,  4,  7,  6,  3,  0,  1; (End)
		

Crossrefs

Cf. A007318 (a=1), A008949(a=2), A164844(a=10).
Similar to the triangles A035317, A059259, A080242, A112555.
Cf. A072547 (central terms).

Programs

  • GAP
    Flat(List([0..13],n->List([0..n],k->Sum([0..k],i->Binomial(n,i)*(-2)^(k-i))))); # Muniru A Asiru, Feb 19 2018
  • Haskell
    a108561 n k = a108561_tabl !! n !! k
    a108561_row n = a108561_tabl !! n
    a108561_tabl = map reverse a112465_tabl
    -- Reinhard Zumkeller, Jan 03 2014
    
  • Maple
    A108561 := (n, k) -> add(binomial(n, i)*(-2)^(k-i), i = 0..k):
    seq(seq(A108561(n,k), k = 0..n), n = 0..12); # Peter Bala, Feb 18 2018
  • Mathematica
    Clear[t]; t[n_, 0] = 1; t[n_, n_] := t[n, n] = (-1)^Mod[n, 2]; t[n_, k_] := t[n, k] = t[n-1, k] + t[n-1, k-1]; Table[t[n, k], {n, 0, 13}, {k, 0, n}] // Flatten (* Jean-François Alcover, Mar 06 2013 *)
  • Sage
    def A108561_row(n):
        @cached_function
        def prec(n, k):
            if k==n: return 1
            if k==0: return 0
            return -prec(n-1,k-1)-sum(prec(n,k+i-1) for i in (2..n-k+1))
        return [(-1)^k*prec(n, k) for k in (1..n-1)]+[(-1)^(n+1)]
    for n in (1..12): print(A108561_row(n)) # Peter Luschny, Mar 16 2016
    

Formula

G.f.: (1-y*x)/(1-x-(y+y^2)*x). - Philippe Deléham, Nov 17 2013
T(n,k) = T(n-1,k) + T(n-2,k-1) + T(n-2,k-2), T(0,0)=T(1,0)=1, T(1,1)=-1, T(n,k)=0 if k < 0 or if k > n. - Philippe Deléham, Nov 17 2013
From Peter Bala, Feb 18 2018: (Start)
T(n,k) = Sum_{i = 0..k} binomial(n,i)*(-2)^(k-i), 0 <= k <= n.
The n-th row polynomial is the n-th degree Taylor polynomial of the rational function (1 + x)^n/(1 + 2*x) about 0. For example, for n = 4, (1 + x)^4/(1 + 2*x) = 1 + 2*x + 2*x^2 + x^4 + O(x^5). (End)

Extensions

Definition corrected by Philippe Deléham, Dec 26 2013

A220074 Triangle read by rows giving coefficients T(n,k) of [x^(n-k)] in Sum_{i=0..n} (x-1)^i, 0 <= n <= k.

Original entry on oeis.org

1, 1, 0, 1, -1, 1, 1, -2, 2, 0, 1, -3, 4, -2, 1, 1, -4, 7, -6, 3, 0, 1, -5, 11, -13, 9, -3, 1, 1, -6, 16, -24, 22, -12, 4, 0, 1, -7, 22, -40, 46, -34, 16, -4, 1, 1, -8, 29, -62, 86, -80, 50, -20, 5, 0, 1, -9, 37, -91, 148, -166, 130, -70, 25, -5, 1
Offset: 0

Views

Author

Mokhtar Mohamed, Dec 03 2012

Keywords

Comments

If the triangle is viewed as a square array S(m, k) = T(m+k, k), 0 <= m, 0 <= k, its first row is (1,0,1,0,1,...) with e.g.f. cosh(x), g.f. 1/(1-x^2) and subsequent rows have g.f. 1/((1+x)^n*(1-x^2)) (substitute x for -x in g.f. for A059259).
By column, S(m, k) is the coefficient of [x^m] in the generating function Sum_{i=0..k} (-1)^i/(1-x)^(i+1).
This is a rational generating function down column k with a power of (1-x) in the denominator; therefore column k is a polynomial in m respectively n. - Mathew Englander, May 14 2014
Column k multiplied by k! seems to correspond to row k of A054651, considered as a polynomial and then evaluated on the negative integers. For example, row 5 of A054651 represents the polynomial x^5 - 5*x^4 + 25*x^3 + 5*x^2 + 94*x + 120. Evaluating that for x = -1, x = -2, x = -3, ... gives (0, -360, -1440, -4080, -9600, -19920, -37680, ...) which is 5! times column 5 of this triangle. - Mathew Englander, May 23 2014
This triangle provides a solution to a question in the mathematics of gambling. For 0 < p < 1 and positive integers N and G with N < G, suppose you begin with N dollars and make repeated wagers, each time winning 1 dollar with probability p and losing 1 dollar with probability 1-p. You continue betting 1 dollar at a time until you have either G dollars (your Goal) or 0 (bankrupt). What is the probability of reaching your Goal before going bankrupt, as a function of p, N, and G? (This is a type of one-dimensional random walk.) Answer: Let Q_m_(x) be the polynomial whose coefficients are given by row m-1 of the triangle (e.g., Q_6_(x) = 1 - 4x + 7x^2 - 6x^3 + 3x^4). Then, the probability of reaching G dollars before going bankrupt is p^(G-N)*Q_N_(p)/Q_G_(p). - Mathew Englander, May 23 2014
From Paul Curtz, Mar 17 2017: (Start)
Consider the triangle Ja(n+1,k) (here, but generally Ja(n,k)) composed of the triangle a(n) prepended with a column of 0's, i.e.,
0;
0, 1;
0, 1, 0;
0, 1, -1, 1;
0, 1, -2, 2, 0;
0, 1, -3, 4, -2, 1;
0, 1, -4, 7, -6, 3, 0;
0, 1, -5, 11, -13, 9, -3, 1;
... .
The row sums are 0, 1, 1, ... = A057427(n), the most elementary autosequence of the first kind (a sequence of the first kind has 0's as main diagonal of its array of successive differences).
The row sums of the absolute values are A001045(n).
Ja applied to a sequence written in its reluctant form yields an autosequence of the first kind. Example: the reluctant form of A001045(n) is 0, 0, 1, 0, 1, 1, 0, 1, 1, 3, 0, 1, 1, 3, 5, ... = Jl.
Jl multiplied by Ja gives the triangle Jal:
0;
0, 1;
0, 1, 0;
0, 1, -1, 3;
0, 1, -2, 6, 0;
0, 1, -3, 12, -10, 11;
0, 1, -4, 21, -30, 33, 0;
0, 1, -5, 33, -65, 99, -63, 43;
... .
The row sums are A001045(n). (End)

Examples

			Triangle begins:
  1;
  1,   0;
  1,  -1,   1;
  1,  -2,   2,    0;
  1,  -3,   4,   -2,    1;
  1,  -4,   7,   -6,    3,    0;
  1,  -5,  11,  -13,    9,   -3,    1;
  1,  -6,  16,  -24,   22,  -12,    4,    0;
  1,  -7,  22,  -40,   46,  -34,   16,   -4,   1;
  1,  -8,  29,  -62,   86,  -80,   50,  -20,   5,   0;
  1,  -9,  37,  -91,  148, -166,  130,  -70,  25,  -5, 1;
  1, -10,  46, -128,  239, -314,  296, -200,  95, -30, 6, 0;
  ...
		

Crossrefs

Similar to the triangles A080242, A108561, A112555, A071920.
Cf. A000124 (column 2), A003600 (column 3), A223718 (column 4, conjectured), A257890 (column 5).

Programs

  • GAP
    Flat(List([0..12], n-> List([0..n], k-> Sum([0..k], j-> (-1)^j*Binomial(n-k+j, j))))); # G. C. Greubel, Feb 18 2019
  • Magma
    [[(&+[(-1)^j*Binomial(n-k+j, j): j in [0..k]]): k in [0..n]]: n in [0..12]]; // G. C. Greubel, Feb 18 2019
    
  • Maple
    A059259A := proc(n,k)
        1/(1+y)/(1-x-y) ;
        coeftayl(%,x=0,n) ;
        coeftayl(%,y=0,k) ;
    end proc:
    A059259 := proc(n,k)
        A059259A(n-k,k) ;
    end proc:
    A220074 := proc(i,j)
        (-1)^j*A059259(i,j) ;
    end proc: # R. J. Mathar, May 14 2014
  • Mathematica
    Table[Sum[(-1)^i*Binomial[n-k+i,i], {i, 0, k}], {n, 0, 12}, {k, 0, n} ]//Flatten (* Michael De Vlieger, Jan 27 2016 *)
  • PARI
    {T(n,k) = sum(j=0,k, (-1)^j*binomial(n-k+j,j))};
    for(n=0,12, for(k=0,n, print1(T(n,k), ", "))) \\ G. C. Greubel, Feb 18 2019
    
  • Sage
    [[sum((-1)^j*binomial(n-k+j,j) for j in (0..k)) for k in (0..n)] for n in (0..12)] # G. C. Greubel, Feb 18 2019
    

Formula

Sum_{k=0..n} T(n,k) = 1.
T(n,k) = Sum_{i=0..k} (-1)^i*binomial(n-k+i, i).
T(2*n,n) = (-1)^n*A026641(n).
T(n,k) = (-1)^k*A059259(n,k).
T(n,0) = 1, T(n,n) = (1+(-1)^n)/2, and T(n,k) = T(n-1,k) - T(n-1,k-1) for 0 < k < n. - Mathew Englander, May 24 2014

Extensions

Definition and comments clarified by Li-yao Xia, May 15 2014
Showing 1-4 of 4 results.