%I #18 Sep 08 2022 08:45:24
%S 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,
%T 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,
%U 10,17,23,33,45,60,76,89,89,1,11,11,19,26,38,53,73,97,123,144,144
%N Triangle generated from an array of generalized Fibonacci-like terms.
%C Difference terms of the array columns in triangle format becomes A117502.
%C 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.
%C This is the lower triangular version of A109754 (without a row and column 0). - _Ross La Haye_, Apr 12 2006
%H G. C. Greubel, <a href="/A117501/b117501.txt">Rows n = 1..100 of triangle, flattened</a>
%F 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)).
%F T(n,k) = n*Fibonacci(k-1) + Fibonacci(k-2). - _G. C. Greubel_, Jul 13 2019
%e First few rows of the array T(n,k) are:
%e k=1 k=2 k=3 k=4 k=5 k=6
%e n=1: 1, 1, 2, 3, 5, 8, ...
%e n=2: 1, 2, 3, 5, 8, 13, ...
%e n=3: 1, 3, 4, 7, 11, 18, ...
%e n=4: 1, 4, 5, 9, 14, 23, ...
%e n=5: 1, 5, 6, 11, 17, 28, ...
%e First few rows of the triangle are:
%e 1;
%e 1, 1;
%e 1, 2, 2;
%e 1, 3, 3, 3;
%e 1, 4, 4, 5, 5;
%e 1, 5, 5, 7, 8, 8;
%e 1, 6, 6, 9, 11, 13, 13;
%e 1, 7, 7, 11, 14, 18, 21, 21; ...
%t 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 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 *)
%o (PARI) T(n,k) = n*fibonacci(k-1) + fibonacci(k-2);
%o for(n=1,15, for(k=1,n, print1(T(n,k), ", "))) \\ _G. C. Greubel_, Jul 13 2019
%o (Python)
%o from sympy.core.cache import cacheit
%o @cacheit
%o def a(n, k):
%o return 1 if k==1 else n if k==2 else a(n, k - 1) + a(n, k - 2)
%o for n in range(1, 21): print([a(n - k + 1, k) for k in range(1, n + 1)]) # _Indranil Ghosh_, Aug 19 2017
%o (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
%o (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
%o (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
%Y Cf. A000045, A001595, A104161 (diagonal sums), A109754 (with column of 0's), A117502.
%K nonn,tabl
%O 1,5
%A _Gary W. Adamson_, Mar 23 2006
%E Row sums comment corrected by _Philippe Deléham_, Nov 18 2013