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

A035002 Square array read by antidiagonals: T(m,n) = Sum_{k=1..m-1} T(m-k,n) + Sum_{k=1..n-1} T(m,n-k).

Original entry on oeis.org

1, 1, 1, 2, 2, 2, 4, 5, 5, 4, 8, 12, 14, 12, 8, 16, 28, 37, 37, 28, 16, 32, 64, 94, 106, 94, 64, 32, 64, 144, 232, 289, 289, 232, 144, 64, 128, 320, 560, 760, 838, 760, 560, 320, 128, 256, 704, 1328, 1944, 2329, 2329, 1944, 1328, 704, 256, 512, 1536, 3104, 4864, 6266
Offset: 1

Views

Author

Keywords

Comments

T(m,n) is the sum of all the entries above it plus the sum of all the entries to the left of it.
T(m,n) equals the number of ways to move a chess rook from the lower left corner to square (m,n), with the rook moving only up or right. - Francisco Santos, Oct 20 2005
T(m+1,n+1) is the number of nim games that start with two piles of stones of sizes m and n. - Martin J. Erickson (erickson(AT)truman.edu), Dec 05 2008
The same sequences arises from reading the following triangle by rows: Start with 1, then use a Pascal-like rule, where each new entry is the sum of all terms in the two diagonals that converge at that point. See example below. - J. M. Bergot, Jun 08 2013
T(n,k) is odd iff (n,k) = (1,1), k = n-1, or k = n+1. - Peter Kagey, Apr 20 2020

Examples

			Table begins:
  1  1  2   4   8  16   32   64 ...
  1  2  5  12  28  64  144  320 ...
  2  5 14  37  94 232  560 1328 ...
  4 12 37 106 289 760 1944 4864 ...
Alternative construction as a triangle:
               1
             1   1
           2   2   2
         4   5   5   4
       8  12  14  12   8
    16  28  37  37  28  16
		

Crossrefs

Cf. A035001, A051708, A025192 (antidiagonal sums).

Programs

  • Maple
    A035002 := proc(m,n)
        option remember;
        if n = 1 and m= 1 then
            1;
        elif m = 1 then
            2^(n-2) ;
        elif n = 1 then
            2^(m-2) ;
        else
            add( procname(m-k,n),k=1..m-1) + add( procname(m,n-k),k=1..n-1) ;
        end if;
    end proc: # R. J. Mathar, Jun 06 2013
  • Mathematica
    T[n_, 1] = 2^(n-2); T[1, n_] = 2^(n-2); T[1, 1] = 1; T[m_, n_] := T[m, n] = Sum[T[m-k, n], {k, 1, m-1}] + Sum[T[m, n-k], {k, 1, n-1}]; Flatten[Table[T[m-n+1 , n], {m, 1, 11}, {n, 1, m}]] (* Jean-François Alcover, Nov 04 2011 *)
    nMax = 11; T = (((x - 1)*y - x + 1)/((3*x - 2)*y - 2*x + 1) + O[x]^nMax // Normal // Expand) + O[y]^nMax // Normal // Expand // CoefficientList[#, {x, y}]&; Table[T[[n - k + 1, k]], {n, 1, nMax}, {k, 1, n}] // Flatten (* Jean-François Alcover, Feb 18 2018, after Vladimir Kruchinin *)
    T[ n_, m_] := SeriesCoefficient[ (1 - x)*(1 - y)/( 1 - 2*x - 2*y + 3*x*y), {x, 0, n}, {y, 0, m}]; (* Michael Somos, Oct 05 2023 *)
  • Maxima
    T(n,m):=sum(binomial(m-1,m-i)*sum(binomial(k+i,i)*binomial(n-1,n-k),k,0,n),i,0,m); /* Vladimir Kruchinin, Apr 14 2015 */

Formula

G.f. T(n; x) for n-th row satisfies: T(n; x) = Sum_{k=1..n} (1+x^k)*T(n-k; x), T(0; x) = 1. - Vladeta Jovovic, Sep 03 2002
T(m+1,n+1) = 2*T(m+1,n) + 2*T(m,n+1) - 3*T(m,n); T(n,1) = T(1,n) = A011782(n). - Francisco Santos, Oct 20 2005
G.f.: ((x-1)*y-x+1)/((3*x-2)*y-2*x+1). - Vladimir Kruchinin, Apr 14 2015
T(n,m) = Sum_{i=0..m} C(m-1,m-i)*Sum_{k=0..n} C(k+i,i)*C(n-1,n-k). - Vladimir Kruchinin, Apr 14 2015
T(n,m) = T(m,n) for all n and m. - Michael Somos, Oct 04 2023
T(n,2) = (n+2)*2^(n-3) for n>1; T(n,3) = (n^2+11*n+14)*2^(n-5) for n>1 - Erich Friedman, Jan 14 2025

A118800 Triangle read by rows: T satisfies the matrix products: C*T*C = T^-1 and T*C*T = C^-1, where C is Pascal's triangle.

Original entry on oeis.org

1, 1, -1, 2, -3, 1, 4, -8, 5, -1, 8, -20, 18, -7, 1, 16, -48, 56, -32, 9, -1, 32, -112, 160, -120, 50, -11, 1, 64, -256, 432, -400, 220, -72, 13, -1, 128, -576, 1120, -1232, 840, -364, 98, -15, 1, 256, -1280, 2816, -3584, 2912, -1568, 560, -128, 17, -1, 512, -2816, 6912, -9984, 9408, -6048, 2688, -816, 162, -19, 1
Offset: 0

Views

Author

Paul D. Hanna, May 02 2006

Keywords

Comments

The matrix square, T^2, consists of columns that are all the same.
Matrix inverse is triangle A118801. Row sums form {0^n, n>=0}.
Unsigned row sums equal A025192(n) = 2*3^(n-1), n>=1.
Row squared sums equal A051708.
Antidiagonal sums equals all 1's.
Unsigned antidiagonal sums form A078057 (with offset).
Antidiagonal squared sums form A002002(n) = Sum_{k=0..n-1} C(n,k+1)*C(n+k,k), n>=1.
From Paul Barry, Nov 10 2008: (Start)
T is [1,1,0,0,0,...] DELTA [ -1,0,0,0,0,...] or C(1,n) DELTA -C(0,n). (DELTA defined in A084938).
The positive matrix T_p is [1,1,0,0,0,...] DELTA [1,0,0,0,0,...]. T_p*C^-1 is
[0,1,0,0,0,....] DELTA [1,0,0,0,0,...] which is C(n-1,k-1) for n,k>=1. (End)
The triangle formed by deleting the minus signs is the mirror of the self-fusion of Pascal's triangle; see Comments at A081277 and A193722. - Clark Kimberling, Aug 04 2011
Riordan array ( (1 - x)/(1 - 2*x), -x/(1 - 2*x) ). Cf. A209149. The matrix square is the Riordan array ( (1 - x)^2/(1 - 2*x), x ), which belongs to the Appell subgroup of the Riordan group. See the Example section below. - Peter Bala, Jul 17 2013
From Peter Bala, Feb 23 2019: (Start)
There is a 1-parameter family of solutions to the simultaneous equations C*T*C = T^-1 and T*C*T = C^-1, where C is Pascal's triangle. Let T(k) denote the Riordan array ( (1 - k*x)/(1 - (k + 1)*x), -x/(1 - (k + 1)*x) ) so that T(1) = T. Then C*T(k)*C = T(k)^-1 and T(k)*C*T(k) = C^-1, for arbitrary k. For arbitrary m, the Riordan arrays (T(k)*C^m)^2 and (C^m*T(k))^2 both belong to the Appell subgroup of the Riordan group.
More generally, given a fixed m, we can ask for a lower triangular array X solving the simultaneous equations (C^m)*X*(C^m) = X^-1 and X*(C^m)*X = C^(-m). A 1-parameter family of solutions is given by the Riordan arrays X = ( (1 - m*k*x)/(1 - m*(k + 1)*x), -x/(1 - m*(k + 1)*x) ). The Riordan arrays X^2 , (X*C^n)^2 and (C^n*X)^2, for arbitrary n, all belong to the Appell subgroup of the Riordan group. (End)

Examples

			Triangle begins:
     1;
     1,    -1;
     2,    -3,     1;
     4,    -8,     5,     -1;
     8,   -20,    18,     -7,     1;
    16,   -48,    56,    -32,     9,     -1;
    32,  -112,   160,   -120,    50,    -11,     1;
    64,  -256,   432,   -400,   220,    -72,    13,    -1;
   128,  -576,  1120,  -1232,   840,   -364,    98,   -15,    1;
   256, -1280,  2816,  -3584,  2912,  -1568,   560,  -128,   17,   -1;
   512, -2816,  6912,  -9984,  9408,  -6048,  2688,  -816,  162,  -19,  1;
  1024, -6144, 16640, -26880, 28800, -21504, 11424, -4320, 1140, -200, 21, -1;
  ...
The matrix square, T^2, equals:
   1;
   0,  1;
   1,  0,  1;
   2,  1,  0,  1;
   4,  2,  1,  0,  1;
   8,  4,  2,  1,  0,  1;
  16,  8,  4,  2,  1,  0,  1;
  32, 16,  8,  4,  2,  1,  0,  1;
  64, 32, 16,  8,  4,  2,  1,  0,  1; ...
where all columns are the same.
		

Crossrefs

Cf. A118801 (inverse), A025192 (unsigned row sums), A051708 (row squared sums), A078057 (unsigned antidiagonal sums), A002002 (antidiagonal squared sums).

Programs

  • Mathematica
    (* This program generates A118800 as the mirror of the self-fusion of Pascal's triangle. *)
    z = 8; a = 1; b = 1; c = 1; d = 1;
    p[n_, x_] := (a*x + b)^n ; q[n_, x_] := (c*x + d)^n;
    t[n_, k_] := Coefficient[p[n, x], x^k]; t[n_, 0] := p[n, 0];
    w[n_, x_] := Sum[t[n, k]*q[n + 1 - k, x], {k, 0, n}]; w[-1, _] = 1;
    g[n_] := CoefficientList[w[n, -x], x];
    TableForm[Table[Reverse[Abs@g[n]], {n, -1, z}]]
    Flatten[Table[Reverse[Abs@g[n]], {n, -1, z}]] (* A081277 *)
    TableForm[Table[g[n], {n, -1, z}]]
    Flatten[Table[g[n], {n, -1, z}]] (* A118800 *)
    (* Clark Kimberling, Aug 04 2011 *)
    T[ n_, k_] := If[ n<0 || k<0, 0, (-1)^k 2^(n-k) (Binomial[ n, k] + Binomial[ n-1, n-k]) / 2]; (* Michael Somos, Nov 25 2016 *)
  • PARI
    {T(n,k)=if(n==0&k==0,1,(-1)^k*2^(n-k)*(binomial(n,k)+binomial(n-1,k-1))/2)}
    for(n=0,12,for(k=0,n,print1(T(n,k),", "));print(""))
    
  • PARI
    /* Chebyshev Polynomials as Antidiagonals: */
    {T(n,k)=local(Ox=x*O(x^(2*k))); polcoeff(((1+sqrt(1-x^2+Ox))^(n+k)+(1-sqrt(1-x^2+Ox))^(n+k))/2,2*k,x)}
    for(n=0,12,for(k=0,n,print1(T(n,k),", "));print(""))
    
  • Sage
    # uses[riordan_square from A321620]
    # Computes the unsigned triangle.
    riordan_square((1-x)/(1-2*x), 8) # Peter Luschny, Jan 03 2019

Formula

T(n,k) = (-1)^k * 2^(n-k) * ( C(n,k) + C(n-1,k-1) )/2 for n>=k>=0 with T(0,0) = 1. Antidiagonals form the coefficients of Chebyshev polynomials: T(n,k) = [x^(2*n)] [(1+sqrt(1-x^2))^(n+k) + (1-sqrt(1-x^2))^(n+k)]/2.
Rows of the triangle are generated by taking successive iterates of (A135387)^n * [1, 1, 0, 0, 0, ...]. - Gary W. Adamson, Dec 09 2007
O.g.f.: (1 - t)/(1 + t*(x - 2)) = 1 + (1 - x)*t + (2 - 3*x + x^2)^t^2 + (4 - 8*x + 5*x^2 - x^3)*t^3 + .... Row polynomial R(n,x) = (1 - x)*(2 - x)^(n-1) for n >= 1. - Peter Bala, Jul 17 2013
T(n,k)=2*T(n-1,k)-T(n-1,k-1) with 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 25 2013
G.f. for row n (n>=1): Sum_{k=0..n} T(n,k)*x^k = (1-x)*(2-x)^(n-1). - Philippe Deléham, Nov 25 2013
From Tom Copeland, Nov 15 2016: (Start)
E.g.f. is [1 + (1-x)e^((2-x)t)]/(2-x), so the row polynomials are p_n(x) = (1-q,(x))^n, umbrally, where (q.(x))^k = q_k(x) are the row polynomials of A239473, or, equivalently, T = M*A239473, where M is the inverse Pascal matrix C^(-1) = A130595 with the odd rows negated, i.e., M(n,k) = (-1)^n C^(-1)(n,k) with e.g.f. exp[(1-x)t]. Cf. A200139: A200139(n,k) = (-1)^k* A118800(n,k).
TCT = C^(-1) = A130595 and A239473 = A000012*C^(-1) = S*C^(-1) imply (M*S)^2 = Identity matrix, i.e., M*S = (M*S)^(-1) = S^(-1)*M^(-1) = A167374*M^(-1). Note that M = M^(-1). Cf. A097805. (End)

A181731 Table A(d,n) of the number of paths of a chess rook in a d-dimensional hypercube from (0...0) to (n...n) where the rook may move in steps that are multiples of (1,0..0), (0,1,0..0), ..., (0..0,1).

Original entry on oeis.org

1, 1, 1, 1, 2, 2, 1, 6, 14, 4, 1, 24, 222, 106, 8, 1, 120, 6384, 9918, 838, 16, 1, 720, 291720, 2306904, 486924, 6802, 32, 1, 5040, 19445040, 1085674320, 964948464, 25267236, 56190, 64, 1, 40320, 1781750880, 906140159280, 4927561419120, 439331916888, 1359631776, 470010, 128, 1, 362880, 214899027840, 1224777388630320, 54259623434853360
Offset: 1

Views

Author

Manuel Kauers, Nov 16 2010

Keywords

Comments

The table is enumerated along antidiagonals: A(1,0), A(2,0), A(1,1), A(3,0), A(2,1), A(1,2), A(4,0), A(3,1), A(2,2), A(1,3), ... .

Examples

			A(3,1) = 6 because there are 6 rook paths on 3D chessboards from (0,0,0) to (1,1,1).
Square table A(d,n) begins:
  1,   1,      2,          4,             8, ...
  1,   2,     14,        106,           838, ...
  1,   6,    222,       9918,        486924, ...
  1,  24,   6384,    2306904,     964948464, ...
  1, 120, 291720, 1085674320, 4927561419120, ...
		

Crossrefs

Rows d=1-12 give: A011782, A051708 (from [1,1]), A144045 (from [1,1,1]), A181749, A181750, A181751, A181752, A181724, A181725, A181726, A181727, A181728.
Columns n=0-2 give: A000012, A000142, A105749.
Main diagonal gives A246623.

Programs

  • Maple
    b:= proc(l) option remember; `if`({l[]} minus {0}={}, 1, add(add
           (b(sort(subsop(i=l[i]-j, l))), j=1..l[i]), i=1..nops(l)))
        end:
    A:= (d, n)-> b([n$d]):
    seq(seq(A(h-n, n), n=0..h-1), h=1..10); # Alois P. Heinz, Jul 21 2012
  • Mathematica
    b[l_List] := b[l] = If[Union[l] ~Complement~ {0} == {}, 1, Sum[ Sum[ b[ Sort[ ReplacePart[l, i -> l[[i]] - j]]], {j, 1, l[[i]]}], {i, 1, Length[l]}]]; A[d_, n_] := b[Array[n&, d]]; Table[Table[A[h-n, n], {n, 0, h-1}], {h, 1, 10}] // Flatten (* Jean-François Alcover, Feb 25 2015, after Alois P. Heinz *)

Extensions

Edited by Alois P. Heinz, Jul 21 2012
Minor edits by Vaclav Kotesovec, Sep 03 2014

A144045 Number of paths of a chess Rook in a cube, from (1,1,1) to (n,n,n), where the rook may move in steps that are multiples of (1,0,0), (0,0,1), or (0,0,1).

Original entry on oeis.org

1, 6, 222, 9918, 486924, 25267236, 1359631776, 75059524392, 4223303759148, 241144782230124, 13930829740017132, 812470444305924300, 47760356825349969600, 2826309951801018736800, 168207011284961649886800, 10060178088232285063542768, 604273284101165691102038556
Offset: 1

Views

Author

Martin J. Erickson (erickson(AT)truman.edu), Sep 08 2008

Keywords

Examples

			a(2)=6 because there are 6 Rook paths from (1,1,1) to (2,2,2).
G.f. = x + 6*x^2 + 222*x^3 + 9918*x^4 + 486924*x^5 + 25267236*x^6 + ...
		

Crossrefs

Cf. A051708.
Row d=3 of A181731.

Formula

a(n) satisfies the recurrence relation a(1) = 1; a(2) = 6; a(3) = 222; a(4) = 9918; a(n) = ((-121 n^3 + 575n^2 - 872n + 412)a(n - 1) + (-475n^3 + 4887n^2 - 16202n + 17448)a(n - 2) + (1746n^3 - 19818n^2 + 75060n - 94896)a(n - 3) + (-1152n^3 + 16128n^2 - 74880n + 115200)a(n - 4))/(-(2n^3 - 8n^2 + 10n - 4)), n>= 5.
G.f.: 1+int(6*hypergeom([1/3, 2/3],[2],27*x*(3*x-2)/(4*x-1)^3)/((4*x-1)*(64*x-1)),x). [Mark van Hoeij, Dec 10 2009]
Asymptotics: a(n) ~ 9*sqrt(3)/(40*Pi*n)*64^(n-1). - Frederic Chyzak, 2010

A307584 Triangle read by rows: T(n,k) is the number of non-backtracking walks on Z^2 of length n that are active for k steps, where the walk is initially active and turns in the walk toggle the activity.

Original entry on oeis.org

1, 2, 1, 2, 6, 1, 2, 14, 10, 1, 2, 22, 42, 14, 1, 2, 30, 106, 86, 18, 1, 2, 38, 202, 318, 146, 22, 1, 2, 46, 330, 838, 722, 222, 26, 1, 2, 54, 490, 1774, 2514, 1382, 314, 30, 1, 2, 62, 682, 3254, 6802, 6062, 2362, 422, 34, 1, 2, 70, 906, 5406, 15378, 20406, 12570, 20406, 12570, 3726, 546, 38, 1
Offset: 1

Views

Author

Matthew Fahrbach, Apr 15 2019

Keywords

Examples

			Triangle begins:
1;
2,  1;
2,  6,   1;
2, 14,  10,    1;
2, 22,  42,   14,     1;
2, 30, 106,   86,    18,     1;
2, 38, 202,  318,   146,    22,     1;
2, 46, 330,  838,   722,   222,    26,    1;
2, 54, 490, 1774,  2514,  1382,   314,   30,   1;
2, 62, 682, 3254,  6802,  6062,  2362,  422,  34,  1;
2, 70, 906, 5406, 15378, 20406, 12570, 3726, 546, 38, 1;
...
		

Crossrefs

Row sums give A000244. Cf. A051708 (subdiagonal T(2n,n)).
Showing 1-5 of 5 results.