Problem

Source: Baltic Way 1998

Tags: combinatorics proposed, combinatorics



We say that some positive integer $m$ covers the number $1998$, if $1,9,9,8$ appear in this order as digits of $m$. (For instance $1998$ is covered by $2\textbf{1}59\textbf{9}36\textbf{98}$ but not by $213326798$.) Let $k(n)$ be the number of positive integers that cover $1998$ and have exactly $n$ digits ($n\ge 5$), all different from $0$. What is the remainder of $k(n)$ on division by $8$?