Ta có:
\(a^2+b^2+c^2=ab+bc+ca\\ \Leftrightarrow2a^2+2b^2+2c^2-2ab-2bc-2ca=0\\ \Leftrightarrow\left(a^2-2ab+b^2\right)+\left(b^2-2bc+c^2\right)+\left(c^2-2ca+a^2\right)=0\\ \Leftrightarrow\left(a-b\right)^2+\left(b-c\right)^2+\left(c-a\right)^2=0\)
Mà \(\left(a-b\right)^2,\left(b-c\right)^2,\left(c-a\right)^2\ge0\Rightarrow\left(a-b\right)^2+\left(b-c\right)^2+\left(c-a\right)^2\ge0\)
\(\Rightarrow\left(a-b\right)^2=\left(b-c\right)^2=\left(c-a\right)^2=0\\ \Leftrightarrow a=b=c\)
Lại có: \(a+b+c=3\Rightarrow a=b=c=1\)
\(\Rightarrow M=1^{2016}+1^{2015}+1^{2020}=1+1+1=3\)