Problem

Source: Rio de Janeiro Mathematical Olympiad 2018, Level 4, #2

Tags: number theory, combinatorics



Let (an) be a sequence of integers, with a1=1 and for evert integer n1, a2n=an+1 and a2n+1=10an. How many times 111 appears on this sequence?