\(M=2^0+2^2+2^4+2^6+2^8+...+2^{2018}\)
\(M=2^0+2^2+\left(2^4+2^6+2^8\right)+...+\left(2^{2014}+2^{2016}+2^{2018}\right)\)
\(M=1+4+2^4.\left(1+2^2+2^4\right)+...+2^{2014}.\left(1+2^2+2^4\right)\)
\(M=5+2^4.21+2^{10}.21+...+2^{2014}.21\)
\(M=5+21.\left(2^4+2^{10}+...+2^{2014}\right)\)
vì \(21.\left(2^4+2^{10}+...+2^{2014}\right)⋮7\)
nên \(M=5+21.\left(2^4+2^{10}+...+2^{2014}\right)\)chia 7 dư 5