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.

A228074 A Fibonacci-Pascal triangle read by rows: T(n,0) = Fibonacci(n), T(n,n) = n and for n > 0: T(n,k) = T(n-1,k-1) + T(n-1,k), 0 < k < n.

Original entry on oeis.org

0, 1, 1, 1, 2, 2, 2, 3, 4, 3, 3, 5, 7, 7, 4, 5, 8, 12, 14, 11, 5, 8, 13, 20, 26, 25, 16, 6, 13, 21, 33, 46, 51, 41, 22, 7, 21, 34, 54, 79, 97, 92, 63, 29, 8, 34, 55, 88, 133, 176, 189, 155, 92, 37, 9, 55, 89, 143, 221, 309, 365, 344, 247, 129, 46, 10
Offset: 0

Views

Author

Reinhard Zumkeller, Aug 15 2013

Keywords

Comments

Sum of n-th row is 2^(n+1) - F(n+1) - 1 = A228078(n+1). - Greg Dresden and Sadek Mohammed, Aug 30 2022

Examples

			.    0:                                 0
.    1:                               1   1
.    2:                             1   2   2
.    3:                          2    3    4   3
.    4:                       3    5    7    7   4
.    5:                     5    8   12   14   11   5
.    6:                  8   13   20   26   25   16   6
.    7:               13   21   33   46   51   41   22   7
.    8:            21   34   54   79   97   92   63   29   8
.    9:          34   55   88  133  176  189  155   92   37   9
.   10:       55   89  143  221  309  365  344  247  129   46  10
.   11:     89  144  232  364  530  674  709  591  376  175  56   11
.   12:  144 233  376  596  894 1204 1383 1300  967  551  231  67   12 .
		

Crossrefs

Cf. A000045 (left edge), A001477 (right edge), A228078 (row sums), A027988 (maxima per row);
some other Fibonacci-Pascal triangles: A027926, A036355, A037027, A074829, A105809, A109906, A111006, A114197, A162741.

Programs

  • GAP
    T:= function(n,k)
        if k=0 then return Fibonacci(n);
        elif k=n then return n;
        else return T(n-1,k-1) + T(n-1,k);
        fi;
      end;
    Flat(List([0..12], n-> List([0..n], k-> T(n,k) ))); # G. C. Greubel, Sep 05 2019
  • Haskell
    a228074 n k = a228074_tabl !! n !! k
    a228074_row n = a228074_tabl !! n
    a228074_tabl = map fst $ iterate
       (\(u:_, vs) -> (vs, zipWith (+) ([u] ++ vs) (vs ++ [1]))) ([0], [1,1])
    
  • Maple
    with(combinat);
    T:= proc (n, k) option remember;
    if k = 0 then fibonacci(n)
    elif k = n then n
    else T(n-1, k-1) + T(n-1, k)
    end if
    end proc;
    seq(seq(T(n, k), k = 0..n), n = 0..12); # G. C. Greubel, Sep 05 2019
  • Mathematica
    T[n_, k_]:= T[n, k]= If[k==0, Fibonacci[n], If[k==n, n, T[n-1, k-1] + T[n -1, k]]]; Table[T[n, k], {n,0,12}, {k,0,n}] (* G. C. Greubel, Sep 05 2019 *)
  • PARI
    T(n,k) = if(k==0, fibonacci(n), if(k==n, n, T(n-1, k-1) + T(n-1, k)));
    for(n=0, 12, for(k=0, n, print1(T(n,k), ", "))) \\ G. C. Greubel, Sep 05 2019
    
  • Sage
    def T(n, k):
        if (k==0): return fibonacci(n)
        elif (k==n): return n
        else: return T(n-1, k) + T(n-1, k-1)
    [[T(n, k) for k in (0..n)] for n in (0..12)] # G. C. Greubel, Sep 05 2019
    

A096601 Triangle (read by rows) where the number of row entries increases by steps of 2 and the entries are stacked in a rectangular fashion. The end entries are set to 1. Rest of entries are set to the sum of the entry directly above in the previous row plus the entry (if present) in the previous row that is either to the left (if the current row number is even) or to the right (if odd).

Original entry on oeis.org

1, 1, 1, 1, 1, 2, 2, 1, 1, 1, 1, 3, 4, 3, 2, 1, 1, 2, 4, 7, 7, 5, 3, 1, 1, 1, 1, 3, 6, 11, 14, 12, 8, 4, 2, 1, 1, 2, 4, 9, 17, 25, 26, 20, 12, 6, 3, 1, 1, 1, 1, 3, 6, 13, 26, 42, 51, 46, 32, 18, 9, 4, 2, 1, 1, 2, 4, 9, 19, 39, 68, 93, 97, 78, 50, 27, 13, 6, 3, 1, 1
Offset: 1

Views

Author

Gerald McGarvey, Aug 14 2004

Keywords

Comments

The row sums are 2^n-1 (A000225). Shares many entries with A027926., e.g. the 'central column' (and greatest numbers in the rows) is A027988 (Greatest number in row n of array T given by A027926.)

Examples

			........................1........................
.....................1..1..1.....................
..................1..2..2..1..1..................
...............1..1..3..4..3..2..1...............
............1..2..4..7..7..5..3..1..1............
.........1..1..3..6.11.14.12..8..4..2..1.........
......1..2..4..9.17.25.26.20.12..6..3..1..1......
...1..1..3..6.13.26.42.51.46.32.18..9..4..2..1...
1..2..4..9.19.39.68.93.97.78.50.27.13..6..3..1..1
		

Crossrefs

Showing 1-2 of 2 results.