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.

A036355 Fibonacci-Pascal triangle read by rows.

Original entry on oeis.org

1, 1, 1, 2, 2, 2, 3, 5, 5, 3, 5, 10, 14, 10, 5, 8, 20, 32, 32, 20, 8, 13, 38, 71, 84, 71, 38, 13, 21, 71, 149, 207, 207, 149, 71, 21, 34, 130, 304, 478, 556, 478, 304, 130, 34, 55, 235, 604, 1060, 1390, 1390, 1060, 604, 235, 55, 89, 420, 1177, 2272, 3310, 3736, 3310, 2272, 1177, 420, 89
Offset: 0

Views

Author

Floor van Lamoen, Dec 28 1998

Keywords

Comments

T(n,k) is the number of lattice paths from (0,0) to (n-k,k) using steps (1,0),(2,0),(0,1),(0,2). - Joerg Arndt, Jun 30 2011, corrected by Greg Dresden, Aug 25 2020
For a closed-form formula for arbitrary left and right borders of Pascal like triangle see A228196. - Boris Putievskiy, Aug 18 2013
For a closed-form formula for generalized Pascal's triangle see A228576. - Boris Putievskiy, Sep 09 2013

Examples

			Triangle begins
   1;
   1,   1;
   2,   2,   2;
   3,   5,   5,    3;
   5,  10,  14,   10,    5;
   8,  20,  32,   32,   20,    8;
  13,  38,  71,   84,   71,   38,   13;
  21,  71, 149,  207,  207,  149,   71,  21;
  34, 130, 304,  478,  556,  478,  304, 130,  34;
  55, 235, 604, 1060, 1390, 1390, 1060, 604, 235, 55;
with indices
  T(0,0);
  T(1,0),  T(1,1);
  T(2,0),  T(2,1),  T(2,2);
  T(3,0),  T(3,1),  T(3,2),  T(3,3);
  T(4,0),  T(4,1),  T(4,2),  T(4,3),  T(4,4);
For example, T(4,2) = 14 and there are 14 lattice paths from (0,0) to (4-2,2) = (2,2) using steps (1,0),(2,0),(0,1),(0,2). - _Greg Dresden_, Aug 25 2020
		

Crossrefs

Row sums form sequence A002605. T(n, 0) forms the Fibonacci sequence (A000045). T(n, 1) forms sequence A001629.
Derived sequences: A036681, A036682, A036683, A036684, A036692 (central terms).
Some other Fibonacci-Pascal triangles: A027926, A037027, A074829, A105809, A109906, A111006, A114197, A162741, A228074.

Programs

  • Haskell
    a036355 n k = a036355_tabl !! n !! k
    a036355_row n = a036355_tabl !! n
    a036355_tabl = [1] : f [1] [1,1] where
       f us vs = vs : f vs (zipWith (+)
                           (zipWith (+) ([0,0] ++ us) (us ++ [0,0]))
                           (zipWith (+) ([0] ++ vs) (vs ++ [0])))
    -- Reinhard Zumkeller, Apr 23 2013
  • Mathematica
    nmax = 11; t[n_, m_] := t[n, m] = tp[n-1, m-1] + tp[n-2, m-2] + tp[n-1, m] + tp[n-2, m]; tp[n_, m_] /; 0 <= m <= n && n >= 0 := t[n, m]; tp[n_, m_] = 0; t[0, 0] = 1; Flatten[ Table[t[n, m], {n, 0, nmax}, {m, 0, n}]] (* Jean-François Alcover, Nov 09 2011, after formula *)
  • PARI
    /* same as in A092566 but use */
    steps=[[1,0], [2,0], [0,1], [0,2]];
    /* Joerg Arndt, Jun 30 2011 */
    

Formula

T(n, m) = T'(n-1, m-1)+T'(n-2, m-2)+T'(n-1, m)+T'(n-2, m), where T'(n, m) = T(n, m) if 0<=m<=n and n >= 0 and T'(n, m)=0 otherwise. Initial term T(0, 0)=1.
G.f.: 1/(1-(1+y)*x-(1+y^2)*x^2). - Vladeta Jovovic, Oct 11 2003

A122680 Number of possible basketball games that end in a tie (n:n). Equivalently, the number of walks on the square lattice from (0,0) to (n,n) where the allowed steps are {(1,0),(2,0),(3,0), (0,1),(0,2),(0,3)}.

Original entry on oeis.org

1, 2, 14, 106, 784, 6040, 47332, 375196, 3001966, 24190148, 196034522, 1596030740, 13044459766, 106961525744, 879512777006, 7249483605580, 59881171431050, 495545064567260, 4107666916668414, 34099685718629264, 283454909832384416, 2359069189033880228
Offset: 0

Views

Author

Doron Zeilberger, Oct 20 2006

Keywords

Comments

Diagonal of the rational function 1 / (1 - x - y - x^2 - y^2 - x^3 - y^3). - Ilya Gutkovskiy, Apr 23 2025

Examples

			a(1) = 2 because the number of ways of getting the score to be (1,1) is
(0,0) -> (1,0) -> (1,1),
(0,0) -> (0,1) -> (1,1).
		

Programs

  • Maple
    b:= proc(x, y) option remember; `if`(x<0 or y<0, 0,
          `if`([x, y]=[0, 0], 1, add(b(x-i, y) +b(x, y-i), i=1..3)))
        end:
    a:= n-> b(n, n):
    seq(a(n), n=0..30);  # Alois P. Heinz, Jul 24 2011
  • Mathematica
    b[x_, y_] := b[x, y] = If[x < 0 || y < 0, 0, If[{x, y} == {0, 0}, 1, Sum[b[x - i, y] + b[x, y - i], {i, 3}]]];
    a[n_] := b[n, n];
    a /@ Range[0, 30] (* Jean-François Alcover, May 13 2020, after Alois P. Heinz *)
Showing 1-2 of 2 results.