OFFSET
1,3
FORMULA
T(n, 1)=1, T(n, k)=0 for k>n, T(n, 2) = T(n-1, 1) + T(n-1, 2) + 2*(-1)^n, T(n, k) = T(n-1, k-1) + T(n-1, k) + (-1)^(n+k) for k>2. [corrected by Frank M Jackson, Mar 27 2012]
EXAMPLE
First rows are:
{1},
{1,3},
{1,2,4},
{1,5,5,5},
{1,4,11,9,6},
{1,7,14,21,14,7},
...
For example, 2 = 1 + 3 - 2, 5 = 1 + 2 + 2; 11 = 5 + 5 + 1, 14 = 4 + 11 - 1.
MATHEMATICA
t[n_, k_] := t[n, k]=Which[k==1, 1, n<k, 0, k==2, t[n-1, 1]+t[n-1, 2]+2(-1)^n, k>2, t[n-1, k-1] + t[n-1, k] + (-1)^(n+k)]; Flatten[Table[t[n, k], {n, 1, 20}, {k, 1, n}]] (* Frank M Jackson, Mar 27 2012 *)
CROSSREFS
KEYWORD
AUTHOR
Paul Barry, Feb 18 2003
EXTENSIONS
Terms corrected and extended by Frank M Jackson, Mar 27 2012
STATUS
approved