Answer:
5
Step-by-step explanation:
According to the described rule, we have
[tex]a_1=7\\ \\a_1^2=7^2=49\Rightarrow a_2=4+9+1=14\\ \\a_2^2=14^2=196\Rightarrow a_3=1+9+6+1=17\\ \\a_3^2=17^2=289\Rightarrow a_4=2+8+9+1=20\\ \\a_4^2=20^2=400\Rightarrow a_5=4+0+0+1=5\\ \\a_5^2=5^2=25\Rightarrow a_6=2+5+1=8\\ \\a_6^2=8^2=64\Rightarrow a_7=6+4+1=11\\ \\a_7^2=11^2=121\Rightarrow a_8=1+2+1+1=5\\ \\\text{and so on...}[/tex]
We can see the pattern
[tex]a_5=a_8=a_{11}=a_{14}=...=5\\ \\a_6=a_9=a_{12}=a_{15}=...=8\\ \\a_7=a_{10}=a_{13}=a_{16}=...=11[/tex]
In other words, for all [tex]k\ge 2[/tex]
[tex]a_{3k-1}=5\\ \\a_{3k}=8\\ \\a_{3k+1}=11[/tex]
Now,
[tex]a_{2018}=a_{3\cdot 673-1}=5[/tex]