Each of the positive integers $1,2,\dots,n$ is colored in one of the colors red, blue or yellow regarding the following rules: (1) A Number $x$ and the smallest number larger than $x$ colored in the same color as $x$ always have different parities. (2) If all colors are used in a coloring, then there is exactly one color, such that the smallest number in that color is even. Find the number of possible colorings.
Problem
Source: Bundeswettbewerb Mathematik 2015 - Round 2 - #3
Tags: Coloring, combinatorics, counting