IMC 2005 · Problem 2

Day 112th IMC · Blagoevgrad, Bulgaria

Statement

For an integer n≥3n \ge 3 consider the sets

Sn={(x1,x2,…,xn):∀i  xi∈{0,1,2}}S_n = \{(x_1, x_2, \dots, x_n) : \forall i \; x_i \in \{0,1,2\}\} An={(x1,x2,…,xn)∈Sn:∀i≤n−2  ∣{xi,xi+1,xi+2}∣≠1}A_n = \{(x_1, x_2, \dots, x_n) \in S_n : \forall i \le n-2 \; |\{x_i, x_{i+1}, x_{i+2}\}| \ne 1\}

and

Bn={(x1,x2,…,xn)∈Sn:∀i≤n−1  (xi=xi+1⇒xi≠0)}.B_n = \{(x_1, x_2, \dots, x_n) \in S_n : \forall i \le n-1 \; (x_i = x_{i+1} \Rightarrow x_i \ne 0)\}.

Prove that ∣An+1∣=3⋅∣Bn∣|A_{n+1}| = 3 \cdot |B_n|.

(∣A∣|A| denotes the number of elements of the set AA.)

Official solution

Hidden so you can work on the problem first.