2013 AIME II Problems/Problem 9
A board is completely covered by tiles without overlap; each tile may cover any number of consecutive squares, and each tile lies completely on the board. Each tile is either red, blue, or green. Let be the number of tilings of the board in which all three colors are used at least once. For example, a red tile followed by a green tile, a green tile, a blue tile, and a green tile is a valid tiling. Note that if the blue tile is replaced by two blue tiles, this results in a different tiling. Find the remainder when is divided by .
Solution
Firstly, we consider how many different ways possible to divide the board.
(1)One piece: ,way in total(since the 3 colors are used at least once, we reject this case)
(2)Two pieces:,,etc,ways in total(rejected for the same reason)
(3)Three pieces:,,,etc,ways in total
(4)Four pieces: (5)Five pieces: (6)Six pieces: (7)Seven pieces:
Secondly, we consider how many ways to color them:
(1)There pieces:
(2)Four pieces:
(3)Five pieces:
(4)Six pieces:
(5)Seven pieces:
Finally, we combine then together:
So the answer is