OFFSET
0,25
LINKS
Alois P. Heinz, Antidiagonals n = 0..27, flattened
Wikipedia, Tromino
EXAMPLE
A(4,4) = 3, because there are 3 tilings of a 4 X 4 rectangle using straight (3 X 1) trominoes and 2 X 2 tiles:
._._____. ._____._. ._._._._.
| |_____| |_____| | | . | . |
| | . | | | | . | | |___|___|
|_|___| | | |___|_| | . | . |
|_____|_| |_|_____| |___|___| .
Square array A(n,k) begins:
1, 1, 1, 1, 1, 1, 1, 1, 1, ...
1, 0, 0, 1, 0, 0, 1, 0, 0, ...
1, 0, 1, 1, 1, 2, 2, 3, 4, ...
1, 1, 1, 2, 3, 4, 8, 13, 19, ...
1, 0, 1, 3, 3, 8, 21, 31, 70, ...
1, 0, 2, 4, 8, 28, 65, 170, 456, ...
1, 1, 2, 8, 21, 65, 267, 804, 2530, ...
1, 0, 3, 13, 31, 170, 804, 2744, 12343, ...
1, 0, 4, 19, 70, 456, 2530, 12343, 66653, ...
MAPLE
b:= proc(n, l) option remember; local k, t;
if max(l[])>n then 0 elif n=0 or l=[] then 1
elif min(l[])>0 then t:=min(l[]); b(n-t, map(h->h-t, l))
else for k do if l[k]=0 then break fi od;
b(n, subsop(k=3, l))+
`if`(k<nops(l) and l[k+1]=0, b(n, subsop(k=2, k+1=2, l)), 0)+
`if`(k+1<nops(l) and l[k+1]=0 and l[k+2]=0,
b(n, subsop(k=1, k+1=1, k+2=1, l)), 0)
fi
end:
A:= (n, k)-> `if`(n>=k, b(n, [0$k]), b(k, [0$n])):
seq(seq(A(n, d-n), n=0..d), d=0..14);
MATHEMATICA
b[n_, l_] := b[n, l] = Module[{ k, t}, If [Max[l] > n, 0, If[n == 0 || l == {}, 1, If[ Min[l] > 0 , t = Min[l]; b[n-t, l-t], k = Position[l, 0, 1][[1, 1]]; b[n, ReplacePart[l, k -> 3]] + If[k < Length[l] && l[[k+1]] == 0, b[n, ReplacePart[l, {k -> 2, k+1 -> 2}]], 0] + If[k+1 < Length[l] && l[[k+1]] == 0 && l[[k+2]] == 0, b[n, ReplacePart[l, {k -> 1, k+1 -> 1, k+2 -> 1}]], 0] ] ] ] ]; a[n_, k_] := If[n >= k, b[n, Array[0&, k]], b[k, Array[0&, n]]]; Table[Table[a[n, d-n], {n, 0, d}], {d, 0, 14}] // Flatten (* Jean-François Alcover, Dec 16 2013, translated from Maple *)
CROSSREFS
KEYWORD
nonn,tabl
AUTHOR
Alois P. Heinz, Dec 02 2012
STATUS
approved