The main idea is to fix $i,j$ and increment $k$.
Solution.
$$(i-j)m_k+(j-k)m_i+(k-i)m_j=(i-j)m_{k+1}+(j-(k+1))m_i+((k+1)-i)m_j=c$$$$(i-j)(m_{k+1}-m_k)+m_j-m_i=0$$Switching $i$ and $j$, and increment $k+1$ to $k+2$, we have
$$(j-i)(m_{k+2}-m_{k+1})+m_i-m_j=0$$Adding gives
$$(i-j)(2m_{k+1}-m_k-m_{k+2})=0$$Plugging $(i,j,k)=(k,k+1,k+2)$ in the question gives $c=2m_{k+1}-m_k-m_{k+2}$, so $c=0$. There are many ways to continue from here. It can also be finished by induction of $n$.
Remark. It can also be finished by noting that $(i-j)(m_{k+1}-m_k)+m_j-m_i=0$ implies that $m_{i+1}-m_i$ is constant for all $i$, which implies that the sequence $\{a_n\}$ is an arithmetic sequence after induction or other methods.