OFFSET
1,2
COMMENTS
Tatami mats are of size 1 X 2; at most 3 may meet at a point.
LINKS
Dean Hickerson, Illustration of first few cases
Dean Hickerson, Filling rectangular rooms with Tatami mats (Includes Mathematica program)
Yasutoshi Kohmoto, Illustration of a(6) = 9
EXAMPLE
For n = 3 there are 2 ways to cover a 2 X 3 room and 1 way to cover a 1 X 6 room, so a(3)=3:
._____. ._____.
|___| | | | | | .___________.
|___|_| |_|_|_| |___|___|___|
MATHEMATICA
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];
A052270[n_] := Module[{i, divs}, divs = Divisors[2 n]; Sum[ti[divs[[i]], 2 n/divs[[i]]], {i, 1, Ceiling[Length[divs]/2]}]];
Table[A052270[n], {n, 1, 50}] (* Jean-François Alcover, May 12 2017, copied and adapted from Dean Hickerson's programs *)
CROSSREFS
KEYWORD
nonn,nice
AUTHOR
EXTENSIONS
Extended by Dean Hickerson, Mar 01 2002
STATUS
approved