# Combinatorics problem (coloring squares)

I'm having some trouble with a combinatorics problem and I was thinking maybe somebody could give me a little help. I've been thinking about it the entire day and I can't get my head around it. It goes like this.

You have 12 pencils of different colors. How many ways are there to color 2*n (n>2) squares (as in 2 rows, n columns) such that no 2 adjacent squares are painted the same color.

Sorry if my wording is a little bit confusing I translated the problem from spanish. I'll attach an image for better understanding.

Here's the image

I can't do it in any way. I've done this before with n=2 (a square made of 4 smaller squares) and it's a matter of separating into 2 cases, but here I have infinite? cases. It's really confusing. If someone could give me a clue it'd of great help. Thanks!

• You might be able to infer a pattern by solving easier versions of the same question. For example, for $n=2$, was there some pattern for the number of colorings as a function of $p$? – David Diaz Dec 20 '18 at 4:30
• @DavidDiaz Hm well I couldn't find a general formula because the number of options you have to color a certain square depends on how you've previously colores its adjacent. So I had to separate in 2 cases, whether the "non-adjacent" squares were the same color or not. Hope it makes sense? – Direwolfox Dec 20 '18 at 4:38

Think of coloring each column. How many ways to color the first column? Now for the second column, you have $$10$$ ways to color the top square different from the bottom square of the first column and $$1$$ way to color the top square the same as the bottom square of the first column. How many ways to color the whole second column? Now argue there are the same number of ways to color each column after the first.