\(a=3+3^2+3^3+.....+3^{2017}+3^{2018}\)
\(3a=3+3^2+3^3+......+3^{2019}\)
\(3a-a=\left(3+3^2+....+3^{2019}\right)-\left(3+3^2+....+3^{2018}\right)\)
\(a=3^{2019}\)
\(\Rightarrow3^{2019}=\left(3^3\right)^{673}\)
\(a=\left(....7\right)^{673}\)
\(\Rightarrow\)tận cùng là 7