Solution (source code)

= Solution

For a conservative system near a stable equilibrium, the quadratic <Lagrangian> has the form $L=\frac12\dot q^TM\dot q-\frac12q^TKq$, with symmetric <mass matrix> $M$ and <stiffness matrix> $K$. A <normal mode> $q=v e^{i\omega t}$ satisfies the <generalized eigenvalue problem for small oscillations> $(K-\omega^2M)v=0$, so the frequency equation is $\det(K-\omega^2M)=0$.

To quadratic order, vertical <velocities> contribute only fourth-order corrections to the <kinetic energy>, leaving $T=(\dot x^2+\dot y^2+\dot z^2)/2$. A string of length $\ell$ with small horizontal difference $d$ shortens its vertical projection by $d^2/(2\ell)$. The upper segment carries all three masses, the middle segment two, and the lower segment one. Hence their increases in <gravitational potential energy> sum to
$$
V=3g\frac{x^2}{2(3a)}+2g\frac{(y-x)^2}{2(2b)}+g\frac{(z-y)^2}{2c}=\frac g2\left[\frac{x^2}{a}+\frac{(x-y)^2}{b}+\frac{(y-z)^2}{c}\right].
$$
Subtracting $V$ from $T$ gives the stated approximate <Lagrangian>. Here $M=I$ and
$$
K=g\begin{pmatrix}a^{-1}+b^{-1}&-b^{-1}&0\\-b^{-1}&b^{-1}+c^{-1}&-c^{-1}\\0&-c^{-1}&c^{-1}\end{pmatrix}.
$$
For a mode with middle displacement zero, write $v=(X,0,Z)^T$. The middle row requires $X/b+Z/c=0$, so $Z=-cX/b$. A nonzero mode then has $X,Z\ne0$, and the outer rows require $\omega^2/g=a^{-1}+b^{-1}=c^{-1}$. Therefore the necessary and sufficient condition is
$$
\boxed{\frac1a+\frac1b-\frac1c=0.}
$$
When it holds, the <mode shape> is $(1,0,-c/b)$ with $\omega=\sqrt{g/c}$. This is the force-cancellation mechanism of the <stationary middle mass in a three-mass spring chain>, applied to the equivalent quadratic stiffnesses here.