Exercise 2. For any strictly positive integer $n$, we define $a_{n}$ as the last digit of the sum of the digits of the number 20052005...2005, (we write "2005" $n$ times in a row). For example, $a_{1}=7$ and $a_{2}=4$.

a) What are the strictly positive integers $n$ such that $a_{n}=0$?

b) Calculate $a_{1}+a_{2}+\cdots+a_{2005}$.
Solution to exercise 2 a) Let $s_{n}$ be the sum of the digits of $20052005 \ldots 2005$. We have $s_{n}=(2+0+0+5) \times n=7 n$. We notice that if $m-n$ is a multiple of $10, s_{m}-s_{n}$ is also a multiple of $10$, so $s_{m}$ and $s_{n}$ have the same last digit, i.e., $a_{n}=a_{m}$. Thus, the sequence $(a_{n})$ is periodic with a period of 10. If $r$ is the remainder of the Euclidean division of $n$ by 10, then $a_{n}=a_{r}$. We calculate the first terms of the sequence: $a_{1}=7, a_{2}=4$, $a_{3}=1, a_{4}=8, a_{5}=5, a_{6}=2, a_{7}=9, a_{8}=6, a_{9}=3$ and $a_{10}=0$. For $n$ a strictly positive integer, if $r \neq 0, r \in\{1,2, \ldots, 9\}$, so $a_{r} \neq 0$ and thus $a_{n} \neq 0$. Conversely, if $r=0, n$ is a multiple of 10, so $n-10$ is also a multiple of 10, so $a_{n}=a_{10}=0$.

Thus, the positive integers $n$ such that $a_{n}=0$ are the strictly positive multiples of 10.

b) From $a_{1}$ to $a_{2000}$, we repeat 200 periods of length 10. Then $a_{2001}=a_{1}=7, a_{2002}=a_{2}=4$, etc. Therefore, the desired sum is $200 \times(7+4+1+8+5+2+9+6+3+0)+7+4+1+8+5=9000+25=9025$.