MathDB
Coloring 1,2,...,n with rules

Source: Bundeswettbewerb Mathematik 2015 - Round 2 - #3

September 4, 2015
Coloringcombinatoricscounting

Problem Statement

Each of the positive integers 1,2,,n1,2,\dots,n is colored in one of the colors red, blue or yellow regarding the following rules: (1) A Number xx and the smallest number larger than xx colored in the same color as xx 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.