Problem where i was encountered was this :
A $7 \times 1$ board is completely covered by $m \times 1$ 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 $N$ be the number of tilings of the $7 \times 1$ board in which all three colors are used at least once.
For example, a $1 \times 1$ red tile followed by a $2 \times 1$ green tile, a $1 \times 1$ green tile, a $2 \times 1$ blue tile, and a $1 \times 1$ green tile is a valid tiling.
Note that if the $2 \times 1$ blue tile is replaced by two $1 \times 1$ blue tiles, this results in a different tiling.
What i did was cases made for total number of tiles:
like for 3 tiles by doing $x_1$+ $x_2$+$x_3$= 7 , where $x_1$,$x_2$,$x_3$ represents lengths of each tile , which should some up to 7 and then multiply by 3! For 3 colours from this method for cases more than 3 tiles ,
i seems like counting wrong always, like for example for 5 tiles i did first $x_1$+...$x_5$ = 7 this tells the number of tiles combinations possible to be 6C4 , and now the tiles can be of two types (1,1,3) ,(1,2,2) , where each represents the colour combinations from three colours .
Now for first type its like choosing 1 , then another 1 ,then 3 so its this: 5C1 * 4C1 * 3C3 and then 3! Mulitpilcation For three colours , similairy next type it would be 5C1 * 4C2 * 2C2 * 3! .
But ik i am making some couting mistake like i need to do some number division or multiplicatiom here which leads to correct answer for every case. Can anyone tell whats wrong in this case of 5 tiles ?