Quantcast
Channel: Active questions tagged tiling - Code Golf Stack Exchange
Viewing all articles
Browse latest Browse all 35

Tiling a staircase with staircases

$
0
0

Background

A staircase polyomino is a polyomino made of unit squares whose shape resembles a staircase. More formally, a staircase polyomino of size \$n\$ is defined as follows:

  • A staircase polyomino of size 1 is a single unit square.
  • A staircase polyomino of size \$n\$ is the same as that of size \$n-1\$ with a horizontal bar of length \$n\$ attached to the bottom, left-aligned.

Let's call them just staircases for brevity.

For example, here are the staircases of size 1 to 4:

####################

Challenge

Given a positive integer \$n\$, calculate the number of ways the staircase of size \$n\$ can be tiled with one or more staircases.

Multiple staircases of same size can be used in a tiling, and the staircases can be rotated. So the following are valid tilings for \$n=4\$:

ABCDEFGHIJAAAAAAAAAAAAABBCBDCC

Standard rules apply. The shortest code in bytes wins.

Test cases

Generated using this Python 3 reference solution.

1 -> 12 -> 23 -> 84 -> 575 -> 8066 -> 208407 -> 1038266

Viewing all articles
Browse latest Browse all 35

Trending Articles