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

%I #15 Sep 07 2021 09:34:33

%S 1,1,1,1,2,2,1,2,3,3,1,2,5,7,7,1,2,5,9,12,12,1,2,5,13,22,29,29,1,2,5,

%T 13,26,41,53,53,1,2,5,13,34,65,101,130,130,1,2,5,13,34,73,129,194,247,

%U 247,1,2,5,13,34,89,185,322,481,611,611,1,2,5,13,34,89,201,386,645,945,1192,1192,1,2,5,13,34,89,233,514,973,1613,2354,2965,2965

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

%C Next term is previous term + terms directly above you on a vertical line.

%C An intermingling of two independent triangles, A106595 and A106596.

%H G. C. Greubel, <a href="/A106580/b106580.txt">Rows n = 0..50 of the triangle, flattened</a>

%F T(n, k) = T(n, k-1) + Sum_{i>=1} T(n-2*i, k-i), with T(n, 0) = 1.

%e Triangle begins as:

%e 1;

%e 1, 1;

%e 1, 2, 2;

%e 1, 2, 3, 3;

%e 1, 2, 5, 7, 7;

%e 1, 2, 5, 9, 12, 12;

%e 1, 2, 5, 13, 22, 29, 29;

%e 1, 2, 5, 13, 26, 41, 53, 53;

%e 1, 2, 5, 13, 34, 65, 101, 130, 130;

%p A106580:= proc(n,k) option remember; if k=0 then 1; else A106580(n,k-1) + add(A106580(n-2*i, k-i), i=1..min(k, floor(n/2), n-k)); fi ; end: for n from 0 to 12 do for k from 0 to n do printf("%d, ", A106580(n,k)); od; od; # _R. J. Mathar_, May 02 2007

%t t[_, 0]= 1; t[n_, k_]:= t[n, k] = t[n, k-1] + Sum[t[n-2j, k-j], {j, 1, Min[k, Floor[n/2], n-k]}]; Table[t[n, k], {n, 0, 12}, {k, 0, n}]//Flatten (* _Jean-François Alcover_, Jan 08 2014, after Maple *)

%o (Sage)

%o @CachedFunction

%o def T(n, k):

%o if (k<0): return 0

%o elif (k==0): return 1

%o else: return T(n, k-1) + sum( T(n-2*j, k-j) for j in (1..min(k, n//2, n-k)))

%o flatten([[T(n,k) for k in (0..n)] for n in (0..10)]) # _G. C. Greubel_, Sep 07 2021

%Y Cf. A106595, A106596.

%K nonn,tabl,easy

%O 0,5

%A _N. J. A. Sloane_, May 30 2005

%E More terms from _R. J. Mathar_, May 02 2007