Number of 3 colorings on grid with constraints

154 Views Asked by At

I am trying to figure out a way to do the following:

Given a $3 \times n$ grid, ($n \geq 2$) choose coloring by using $3$ colors (say, RGB), such that

  1. any given column cannot have all grids of same color (i.e., no RRR in any single given column),

  2. a given row (which is of length $n$) cannot have all the same color.

Using the inclusion-exclusion principle and basic combinatorial principles seems like the right approach, but I am not sure of the pattern.