7. (10 points) A sequence of numbers $a_{1}, a_{2}, \cdots, a_{n} \cdots$, let $S(a_{i})$ be the sum of all digits of $a_{i}$, for example, $S(22)=2+2=4$. If $a_{1}=2017, a_{2}=22, a_{n}=S(a_{n-1})+S(a_{n-2})$, then $a_{2017}$ equals $\qquad$
【Analysis】First, we need to clearly understand the meaning of $S\left(a_{i}\right)$, which is the sum of the digits of the natural number $a_{i}$. Then, based on the recursive formula for $a_{n}$, list the data and find the pattern.

【Solution】Solution: $S\left(a_{i}\right)$ represents the sum of the digits of the natural number $a_{i}$, and $a_{n}=S\left(a_{n-1}\right)+S\left(a_{n-2}\right)$. In the table below, we list $a_{n}$ and $S\left(a_{n}\right)$ for $n=1,2,3,4, \cdots$:
\begin{tabular}{|c|c|c|}
\hline$n$ & $a_{n}$ & $S\left(a_{n}\right)$ \\
\hline 1 & 2017 & 10 \\
\hline 2 & 22 & 4 \\
\hline 3 & 14 & 5 \\
\hline 4 & 9 & 9 \\
\hline 5 & 14 & 5 \\
\hline 6 & 14 & 5 \\
\hline 7 & 10 & 1 \\
\hline 8 & 6 & 6 \\
\hline 9 & 7 & 7 \\
\hline 10 & 13 & 4 \\
\hline 11 & 11 & 2 \\
\hline 12 & 6 & 6 \\
\hline
\end{tabular}
\begin{tabular}{|c|c|c|}
\hline 13 & 8 & 8 \\
\hline 14 & 14 & 5 \\
\hline 15 & 13 & 4 \\
\hline 16 & 9 & 9 \\
\hline 17 & 13 & 4 \\
\hline 18 & 13 & 4 \\
\hline 19 & 8 & 8 \\
\hline 20 & 12 & 3 \\
\hline 21 & 11 & 2 \\
\hline 22 & 5 & 5 \\
\hline 23 & 7 & 7 \\
\hline 24 & 12 & 3 \\
\hline 25 & 10 & 1 \\
\hline 26 & 4 & 4 \\
\hline 27 & 5 & 5 \\
\hline 28 & 9 & 9 \\
\hline 29 & 14 & 5 \\
\hline 30 & 14 & 5 \\
\hline 31 & 10 & 1 \\
\hline 32 & 6 & 6 \\
\hline
\end{tabular}

From the above table, we can derive:
$$
\begin{array}{l}
a_{4}=a_{28}=9, S\left(a_{4}\right)=S\left(a_{28}\right)=9 ; \\
a_{5}=a_{29}=14, S\left(a_{5}\right)=S\left(a_{29}\right)=5 ; \\
\ldots
\end{array}
$$

We can conclude the pattern: when $i \geqslant 4$, $a_{i}=a_{i+24}, S\left(a_{i}\right)=S\left(a_{i+24}\right)$,
$$
2017-3=2014,2014 \div 24=83 \cdots 22 \text {, }
$$

Therefore: $a_{2017}=a_{3+22}=a_{25}=10$.