OFFSET
1,2
LINKS
Alois P. Heinz, Table of n, a(n) for n = 1..200
EXAMPLE
The array begins:
1 2 1 13 1
1 3 10 14
5 6 25
1 34
40
MAPLE
T:= proc(n, k) option remember;
if n<1 or k<1 then 0
elif n=1 and irem(k, 2)=1 or k=1 and irem(n, 2)=0 then 1
elif irem(n+k, 2)=0 then T(n-1, k+1)+T(n-1, k)+T(n-2, k)
else T(n+1, k-1)+T(n, k-1)+T(n, k-2)
fi
end:
a:= n-> `if`(irem (n, 2)=0, T(1, n), T(n, 1)):
seq(a(n), n=1..30); # Alois P. Heinz, Feb 08 2011
MATHEMATICA
T[n_, k_] := T[n, k] = Which[n < 1 || k < 1, 0
, n == 1 && Mod[k, 2] == 1 || k == 1 && Mod[n, 2] == 0, 1
, Mod[n + k, 2] == 0, T[n - 1, k + 1] + T[n - 1, k] + T[n - 2, k]
, True, T[n + 1, k - 1] + T[n, k - 1] + T[n, k - 2]];
a[n_] := If[Mod [n, 2] == 0, T[1, n], T[n, 1]];
Table[a[n], {n, 1, 30}] (* Jean-François Alcover, Mar 11 2022, after Alois P. Heinz *)
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Floor van Lamoen, Jul 11 2001
EXTENSIONS
More terms from Alois P. Heinz, Feb 08 2011
STATUS
approved