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.

A117501 Triangle generated from an array of generalized Fibonacci-like terms.

Original entry on oeis.org

1, 1, 1, 1, 2, 2, 1, 3, 3, 3, 1, 4, 4, 5, 5, 1, 5, 5, 7, 8, 8, 1, 6, 6, 9, 11, 13, 13, 1, 7, 7, 11, 14, 18, 21, 21, 1, 8, 8, 13, 17, 23, 29, 34, 34, 1, 9, 9, 15, 20, 28, 37, 47, 55, 55, 1, 10, 10, 17, 23, 33, 45, 60, 76, 89, 89, 1, 11, 11, 19, 26, 38, 53, 73, 97, 123, 144, 144
Offset: 1

Views

Author

Gary W. Adamson, Mar 23 2006

Keywords

Comments

Difference terms of the array columns in triangle format becomes A117502.
Row sums of the triangle are A104161: (1, 2, 5, 10, 19, 34, 59, ...), generated by a(k) = a(k-1) + a(k-2) + n.
This is the lower triangular version of A109754 (without a row and column 0). - Ross La Haye, Apr 12 2006

Examples

			First few rows of the array T(n,k) are:
       k=1 k=2 k=3 k=4 k=5 k=6
  n=1:  1,  1,  2,  3,  5,  8, ...
  n=2:  1,  2,  3,  5,  8, 13, ...
  n=3:  1,  3,  4,  7, 11, 18, ...
  n=4:  1,  4,  5,  9, 14, 23, ...
  n=5:  1,  5,  6, 11, 17, 28, ...
First few rows of the triangle are:
  1;
  1, 1;
  1, 2, 2;
  1, 3, 3,  3;
  1, 4, 4,  5,  5;
  1, 5, 5,  7,  8,  8;
  1, 6, 6,  9, 11, 13, 13;
  1, 7, 7, 11, 14, 18, 21, 21; ...
		

Crossrefs

Cf. A000045, A001595, A104161 (diagonal sums), A109754 (with column of 0's), A117502.

Programs

  • GAP
    F:=Fibonacci;; Flat(List([1..15], n-> List([1..n], k-> (n-k+1)*F(k-1) + F(k-2) ))); # G. C. Greubel, Jul 13 2019
  • Magma
    F:=Fibonacci; [(n-k+1)*F(k-1) + F(k-2): k in [1..n], n in [1..15]]; // G. C. Greubel, Jul 13 2019
    
  • Mathematica
    a[n_, k_] := a[n, k] = If[k==1, 1, If[k==2, n, a[n, k-1] + a[n, k-2]]]; Table[a[n-k+1, k], {n, 1, 10}, {k, 1, n}] // Flatten (* Jean-François Alcover, Aug 15 2017 *)
    T[n_, k_]:= n*Fibonacci[k-1] + Fibonacci[k-2]; Table[T[n-k+1, k], {n, 15}, {k, n}]//Flatten (* G. C. Greubel, Jul 13 2019 *)
  • PARI
    T(n,k) = n*fibonacci(k-1) + fibonacci(k-2);
    for(n=1,15, for(k=1,n, print1(T(n,k), ", "))) \\ G. C. Greubel, Jul 13 2019
    
  • Python
    from sympy.core.cache import cacheit
    @cacheit
    def a(n, k):
        return 1 if k==1 else n if k==2 else a(n, k - 1) + a(n, k - 2)
    for n in range(1, 21): print([a(n - k + 1, k) for k in range(1, n + 1)]) # Indranil Ghosh, Aug 19 2017
    
  • Sage
    f=fibonacci; [[(n-k+1)*f(k-1) + f(k-2) for k in (1..n)] for n in (1..15)] # G. C. Greubel, Jul 13 2019
    

Formula

The triangle by rows = antidiagonals of an array in which n-th row is generated by a Fibonacci-like operation: (1, n...then a(k+1) = a(k) + a(k-1)).
T(n,k) = n*Fibonacci(k-1) + Fibonacci(k-2). - G. C. Greubel, Jul 13 2019

Extensions

Row sums comment corrected by Philippe Deléham, Nov 18 2013