Skip to main content
1 of 3
Robert Israel
  • 54.2k
  • 1
  • 76
  • 152

Let $f(m,n)$ be the number of ways to tile a shape consisting of a $1 \times n$ rectangle on top of a $1 \times n$ rectangle with right sides aligned. You want $f(n,n)$. If $m \ne n$, the leftmost tile could be a $1 \times j$ for $1 \le j \le \max(m,n)$. If $m = n$, you could have a $2 \times j$ or a $1 \times j$ atop a $1 \times k$. Thus
$$ f(m,n) = \cases{\sum_{j=1}^m f(m-j,n) & if $m > n$\cr \sum_{j=1}^n f(m,n-j) & if $m < n$\cr \sum_{j=1}^m f(m-j,m-j) + \sum_{j=1}^m \sum_{k=1}^m f(m-j,m-k) & if $m = n$\cr} $$ It appears that $f(n,n)$ is OEIS sequence A025192.

Robert Israel
  • 54.2k
  • 1
  • 76
  • 152