OFFSET
0,8
LINKS
Michael De Vlieger, Table of n, a(n) for n = 0..11325 (antidiagonals 1..150, flattened)
Dean Hickerson, Filling rectangular rooms with Tatami mats
EXAMPLE
Table begins:
0, 1, 0, 1, 0, 1, 0, ...
1, 1, 2, 3, 4, 6, 8, ...
0, 2, 0, 2, 0, 2, 0, ...
1, 3, 2, 1, 2, 2, 2, ...
0, 4, 0, 2, 0, 1, 0, ...
1, 6, 2, 2, 1, 1, 1, ...
0, 8, 0, 2, 0, 1, 0, ...
...
MATHEMATICA
(* See link above for Mathematica programs. *)
c[r_, s_] := Which[s<0, 0, r==1, 1 - Mod[s, 2], r == 2, c1[2, s] + c2[2, s] + Boole[s == 0], OddQ[r], c[r, s] = c[r, s - r + 1] + c[r, s - r - 1] + Boole[s == 0], EvenQ[r], c[r, s] = c1[r, s] + c2[r, s] + Boole[s == 0]];
c1[r_, s_] := Which[s <= 0, 0, r == 2, c[2, s - 1], EvenQ[r], c2[r, s - 1] + Boole[s == 1]];
c2[r_, s_] := Which[s <= 0, 0, r == 2, c2[2, s] = c1[2, s - 2] + Boole[s == 2], EvenQ[r], c2[r, s] = c1[r, s - r + 2] + c1[r, s - r] + Boole[s == r - 2] + Boole[s == r]];
cs[r_, s_] := Which[s < 0, 0, r == 1, c[r, s], r == 2, cs[2, s] = c1s[r, s] + c2s[r, s] + Boole[s == 0], OddQ[r], cs[r, s] = cs[r, s - 2 r + 2] + cs[r, s - 2 r - 2] + Boole[s == 0] + Boole[s == r - 1] + Boole[s == r + 1], EvenQ[r], cs[r, s] = c1s[r, s] + c2s[r, s] + Boole[s == 0]];
c1s[r_, s_] := Which[s <= 0, 0, r == 2, cs[r, s - 2] + Boole[s == 1], EvenQ[r], c2s[r, s - 2] + Boole[s == 1]];
c2s[r_, s_] := Which[s <= 0, 0, r == 2, c2s[2, s] = c1s[2, s - 4] + Boole[s == 2], EvenQ[r], c2s[r, s] = c1s[r, s - 2 r + 4] + c1s[r, s - 2 r] + Boole[s == r - 2] + Boole[s == r]];
ti[r_, s_] := Which[r > s, ti[s, r], r == s, 1 - Mod[r, 2], True, (c[r, s] + cs[r, s])/2];
A068926[n_] := Module[{x}, x = Floor[(Sqrt[8 n + 1] - 1)/2]; ti[n + 1 - x (x + 1)/2, (x + 1) (x + 2)/2 - n]];
Table[A068926[n], {n, 0, 100}] (* Jean-François Alcover, May 12 2017, copied and adapted from Dean Hickerson's programs *)
CROSSREFS
KEYWORD
nonn,tabl
AUTHOR
Dean Hickerson, Mar 11 2002
STATUS
approved