Red and Blue

A problem from the 1996-1997 Estonian Mathematical Olympiad:

A square tabletop measures 3n × 3n. Each unit square is either red or blue. Each red square that doesn’t lie at the edge of the table has exactly five blue squares among its eight neighbors. Each blue square that doesn’t lie at the edge of the table has exactly four red squares among its eight neighbors. How many squares of each color make up the tabletop?

Click for Answer