Problem

Source: China south east mathematical Olympiad 2008 day2 problem 8

Tags: number theory unsolved, number theory



Let $n$ be a positive integer. $f(n)$ denotes the number of $n$-digit numbers $\overline{a_1a_2\cdots a_n}$(wave numbers) satisfying the following conditions : (i) for each $a_i \in\{1,2,3,4\}$, $a_i \not= a_{i+1}$, $i=1,2,\cdots$; (ii) for $n\ge 3$, $(a_i-a_{i+1})(a_{i+1}-a_{i+2})$ is negative, $i=1,2,\cdots$. (1) Find the value of $f(10)$; (2) Determine the remainder of $f(2008)$ upon division by $13$.