login
Triangle T(n,k) read by rows. T(n,1) = A000045(n+1), k > 1: T(n,k) = (Sum_{i=1..k-1} T(n-i,k-1)) - (Sum_{i=1..k-1} T(n-i,k)).
2

%I #43 Oct 14 2024 01:32:15

%S 1,2,1,3,1,1,5,2,1,1,8,3,1,1,1,13,5,3,1,1,1,21,8,4,2,1,1,1,34,13,6,4,

%T 2,1,1,1,55,21,11,6,3,2,1,1,1,89,34,17,9,6,3,2,1,1,1,144,55,27,15,9,5,

%U 3,2,1,1,1,233,89,45,25,14,9,5,3,2,1,1,1,377,144,72,40,23,14,8,5,3,2,1,1,1

%N Triangle T(n,k) read by rows. T(n,1) = A000045(n+1), k > 1: T(n,k) = (Sum_{i=1..k-1} T(n-i,k-1)) - (Sum_{i=1..k-1} T(n-i,k)).

%H Andrew Howroyd, <a href="/A178534/b178534.txt">Table of n, a(n) for n = 1..1275</a> (rows 1..50)

%F T(n,1) = A000045(n+1), k>1: T(n,k) = Sum_{i=1..k-1} T(n-i,k-1) - Sum_{i=1..k-1} T(n-i,k).

%F T(n,k) = A129713*A051731. - _Mats Granvik_, Oct 22 2010

%F From _R. J. Mathar_, Sep 16 2017: (Start)

%F G.f. 3rd column: x^3*(1+x)/((1-x-x^2)*(1+x+x^2)).

%F G.f. 4th column: x^4/((1-x-x^2)*(1+x^2)) =x^4*(1+x)/((1-x-x^2)*(1+x+x^2+x^3)).

%F G.f. 5th column: x^5*(1+x)/((1-x-x^2)*(1+x+x^2+x^3+x^4)).

%F G.f. 6th column: x^6/((1-x-x^2)*(1+x+x^2)*(1-x+x^2)) = x^6*(1+x)/((1-x-x^2)*(1+x+x^2+x^3+x^4+x^5)).

%F G.f. 7th column: x^7*(1+x)/((1-x-x^2)*(1+x+x^2+x^3+x^4+x^5+x^6)).

%F G.f. 8th column: x^8/((1-x-x^2)*(1+x^2)*(1+x^4)) = x^8*(1+x)/((1-x-x^2)*(1+x+x^2+x^3+x^4+x^5+x^6+x^7)).

%F Conjecture (by extrapolating): G.f. k-th column: x^k*(1-x^2)/((1-x-x^2)*(1-x^k)).

%F G.f.: (1-x^2)/(1-x-x^2)*Sum_{i>=1} (x*y)^i/(1-x^i) = (1-x^2)/(1-x-x^2)*A051731(x,y). (End)

%F T(n,k) = A051731(n,k) + Sum_{j=1..floor(n/k)} Fibonacci(n-j*k). - _Andrew Howroyd_, Feb 23 2024

%e Table begins:

%e 1;

%e 2, 1;

%e 3, 1, 1;

%e 5, 2, 1, 1;

%e 8, 3, 1, 1, 1;

%e 13, 5, 3, 1, 1, 1;

%e 21, 8, 4, 2, 1, 1, 1;

%e 34, 13, 6, 4, 2, 1, 1, 1;

%e 55, 21, 11, 6, 3, 2, 1, 1, 1;

%e 89, 34, 17, 9, 6, 3, 2, 1, 1, 1;

%p A178534 := proc(n, k)

%p option remember;

%p if k= 1 then

%p combinat[fibonacci](n+1) ;

%p elif k > n then

%p 0 ;

%p else

%p add(procname(n-i, k-1), i=1..k-1)-add(procname(n-i, k), i=1..k-1) ;

%p end if;

%p end proc:

%p seq(seq(A178534(n,k),k=1..n),n=1..12) ; # _R. J. Mathar_, Oct 28 2010

%t T[n_, 1] := Fibonacci[n+1];

%t T[n_, k_] := T[n, k] = If[k > n, 0, Sum[T[n-i, k-1], {i, 1, k-1}] - Sum[T[n-i, k], {i, 1, k-1}]];

%t Table[T[n, k], {n, 1, 13}, {k, 1, n}] // Flatten (* _Jean-François Alcover_, Feb 23 2024 *)

%o (Python)

%o from sympy.core.cache import cacheit

%o from sympy import fibonacci

%o @cacheit

%o def A(n, k): return fibonacci(n + 1) if k==1 else 0 if k>n else sum([A(n - i, k - 1) for i in range(1, k)]) - sum([A(n - i, k) for i in range(1, k)])

%o for n in range(1, 13): print([A(n, k) for k in range(1, n + 1)]) # _Indranil Ghosh_, Sep 15 2017

%o (PARI) T(n,k)=(n % k==0) + sum(j=1,n\k,fibonacci(n-j*k)) \\ _Andrew Howroyd_, Feb 23 2024

%Y Cf. 1st column=A000045(n+1), 2nd=A000045, 3rd=A093040, 4th=A006498. Matrix inverse of A178535.

%Y Cf. A051731, A129713.

%K nonn,tabl

%O 1,2

%A _Mats Granvik_, May 29 2010