The lateral surface of a cylinder of revolution is divided by $n-1$ planes parallel to the base and $m$ parallel generators into $mn$ cases $( n\ge 1,m\ge 3)$. Two cases will be called neighbouring cases if they have a common side. Prove that it is possible to write a real number in each case such that each number is equal to the sum of the numbers of the neighbouring cases and not all the numbers are zero if and only if there exist integers $k,l$ such that $n+1$ does not divide $k$ and
\[ \cos \frac{2l\pi}{m}+\cos\frac{k\pi}{n+1}=\frac{1}{2}\]
Ciprian Manolescu
I think I found a solution for the forward direction:
Denote the entries of the cylindrical grid by $\{x_{i,j}\}_{1 \le i \le n, 1 \le j \le m}$. Throughout we will assume that the second indices are always taken $\pmod m$. Then $\forall (i,j) \in [n] \times [m]$, we have that $x_{i,j} = x_{i-1,j} + x_{i,j-1} + x_{i,j+1} + x_{i+1,j}$ where $\forall j \in [m]$, $x_{0,j} = x_{n+1,j} = 0$, which can be naturally assumed as this makes the math remain valid. We then formally define these as the values of $x_{0,j}$ and $x_{n+1,j}$. We also have that $\exists (i,j) \in [n] \times [m]$ such that $x_{i,j} \neq 0$.
Observe that given the complete list of entries of any two adjacent columns of the cylindrical grid, all entries of the grid are determined, as knowing $x_{i-1,j}, x_{i,j-1}, x_{i,j}, x_{i,j+1}$ implies the value of $x_{i+1,j}$ through $x_{i+1,j} = x_{i,j} - x_{i-1,j} - x_{i,j-1} - x_{i,j+1}$. Thus, the entries of any column of the cylindrical grid can be represented as a linear combination of the entries of the previous two columns (WLOG going counterclockwise when viewed from above).
Formally, given a pair of adjacent columns $\vec{x}_i = (x_{1,i}, x_{2,i}, \ldots, x_{n,i})^T$ and $\vec{x}_{i+1} = (x_{1,i+1}, x_{2,i+1},\ldots, x_{n,i+1})^T$, we define $\vec{y}_i = (x_{1,i+1}, x_{2,i+1}, \ldots, x_{n,i+1}, x_{1,i}, x_{2,i}, \ldots, x_{n,i})^T$ and the $2n \times 2n$ matrix $A_n$ such that all main diagonal entries in the top left quadrant are $1$ and all entries $1$ away from the main diagonal in the top left quadrant are $-1$. In the top right quadrant, all main diagonal entries are $-1$. In the bottom left quadrant, all main diagonal entries are $1$. All other entries are $0$.
As an example, this is $A_5$:
$\begin{bmatrix}
1 & -1 & 0 & 0 & 0 & -1 & 0 & 0 & 0 & 0\\
-1 & 1 & -1 & 0 & 0 & 0 & -1 & 0 & 0 & 0\\
0 & -1 & 1 & -1 & 0 & 0 & 0 & -1 & 0 & 0\\
0 & 0 & -1 & 1 & -1 & 0 & 0 & 0 & -1 & 0\\
0 & 0 & 0 & -1 & 1 & 0 & 0 & 0 & 0 & -1\\
1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0\\
0 & 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0\\
0 & 0 & 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0\\
0 & 0 & 0 & 1 & 0 & 0 & 0 & 0 & 0 & 0\\
0 & 0 & 0 & 0 & 1 & 0 & 0 & 0 & 0 & 0\\
\end{bmatrix}$
Proof: The relevance of $A_n$ is that $\forall i$, $A_n \vec{y}_i = \vec{y}_{i+1}$ by the definition of the addition property of the cylindrical grid. Then $A_n^m \vec{y}_i = \vec{y}_i$, i.e. $(A_n^m - I)\vec{y}_i = \vec{0}$, so by definition, $1$ is an eigenvalue of $A_n^m$.
It is well known that given a polynomial $p(x) = a_s x^s + \cdots + a_1 x + a_0$ and a matrix $A$ with its multiset of eigenvalues being $E(A)$, then $E(p(A)) \subseteq p(E(A)) := \{p(\lambda) \mid \lambda \in E(A)\}$ where $p(A) := a_s A^s + \cdots + a_1 A + a_0I$. In fact, $E(p(A)) = p(E(A))$ as multisets but we only need the left to right inclusion just mentioned, which can be proven in this wayConsider $\mu \in E(p(A))$. By definition then, there exists $\vec{w} \neq \vec{0}$ such that $p(A)\vec{w} = \mu \vec{w}$.
The polynomial $p(x) - \mu$ can be factored over $\mathbb{C}$ as:
\begin{align*}
p(x) - \mu = a(x-s_1)(x-s_2) \cdots (x-s_r)
\end{align*}
Then:
\begin{align*}
p(A) - \mu I = a(A - s_1I)(A - s_2I) \cdots (A - s_rI)
\end{align*}
As $\mu$ is an eigenvalue of $p(A)$, $p(A) - \mu I$ is not invertible so there exists some $i$ so that $A - s_i I$ is non-invertible, i.e. $s_i$ is an eigenvalue of $A$. Since $p(s_i) - \mu = 0$, $\mu \in p(E(A))$, so $E(p(A)) \subseteq p(E(A))$, as witnessed by the eigenvalue $s_i$ of $A$. $\blacksquare$.
Thus $1 \in \{\lambda^m \mid \lambda \in E(A_n)\} \Rightarrow \exists \lambda \in E(A_n)$ such that $\lambda^m = 1$. This eigenvalue $\lambda$ of $A_n$ is then of the form $cis(2\pi l / m)$ for some $l \in \{0, 1, \ldots, m-1\}$. $\blacksquare$
Let $\vec{v} = (v_1^{(1)}, v_2^{(1)}, \ldots, v_n^{(1)}, v_1^{(2)}, v_2^{(2)}, \ldots, v_n^{(2)})^T$ be an eigenvector corresponding to $\lambda = cis(2\pi l / m)$ for $A_n$. Then $A_n \vec{v} = \lambda \vec{v}$. We then have $\forall i \in [n]$:
\begin{align*}
v_i^{(1)} &= \lambda v_i^{(2)} \text{ and}\\
-v_{i-1}^{(1)} + v_i^{(1)} - v_{i+1}^{(1)} - v_i^{(2)} &= \lambda v_i^{(1)}\\
\Longrightarrow v_{i+1}^{(1)} &= (1-\lambda)v_{i}^{(1)} - v_{i-1}^{(1)} - v_i^{(2)}\\
\Longrightarrow v_{i+1}^{(1)} &= \left(1-\lambda-\frac{1}{\lambda}\right)v_{i}^{(1)} - v_{i-1}^{(1)}
\end{align*}
Let $b = 1 - \lambda - \frac{1}{\lambda} = 1 - 2\cos(2\pi l / m)$. Then we have that for $i \in [n]$, $v_{i+1}^{(1)} = b v_i^{(1)} - v_{i-1}^{(1)}$, where, like above, we may take $v_0^{(1)} = v_{n+1}^{(1)} = 0$, as the calculations remain correct when calculating the value of $v_n^{(1)}$ from only the previous entry. $\blacksquare$
From claim 2, $v_{i+1}^{(1)} = b v_i^{(1)} - v_{i-1}^{(1)}$ with $v_{0}^{(1)} = 0$ and $v_i^{(2)} = \frac{1}{\lambda} v_i^{(1)}$. If $v_1^{(1)} = 0$, then it is straightforward to see that $\forall i$, $v_i^{(1)} = v_i^{(2)} = 0$, so $\vec{v} = \vec{0}$, contradicting the fact that $\vec{v}$ is an eigenvector of $A_n$. $\blacksquare$
From claim 3, $v_1^{(1)} \neq 0$ and we can scale $\vec{v}$ so that $v_1^{(1)} > 0$. Assume for contradiction that $b \ge 2$. We can then prove by induction that $v_{i+1}^{(1)} \ge v_i^{(1)} \ge 0$. The base follows from the initial conditions of $v_{1}^{(0)}$ and $v_{1}^{(1)}$ and the choice WLOG of sign of $v_1^{(1)}$. Now assume $v_{i}^{(1)} \ge v_{i-1}^{(1)} \ge 0$. Then:
\begin{align*}
v_{i+1}^{(1)} &= b v_i^{(1)} - v_{i-1}^{(1)} \\
&\ge 2 v_i^{(1)} - v_{i-1}^{(1)}\\
&= v_i^{(1)} + (v_i^{(1)} - v_{i-1}^{(1)})\\
&\ge v_i^{(1)} \ge 0
\end{align*}
This implies that $0 \le v_1^{(1)} \le v_2^{(1)} \le \cdots \le v_n^{(1)} \le 0$, so $v_1^{(1)} = v_2^{(1)} = \cdots = v_n^{(1)} = 0$ and by the condition $v_i^{(1)} = \lambda v_i^{(2)}$, $\forall i, v_i^{(2)} = 0$ as well, so $\vec{v} = \vec{0}$, which again cannot follow since $\vec{v}$ is an eigenvector of $A_n$. $\blacksquare$
Recall that $b = 1 - 2\cos(2\pi l/m)$ so $b \ge -1$. From claim 4, $b < 2$ as well, so we can express $b$ as $2\cos \theta$ for some $\theta \in \left(0, \frac{2\pi}{3}\right]$. We may then scale $v_1^{(1)} > 0$ to be $2 \sin \theta > 0$.
It then follows that $\forall t$, $v_t^{(1)} = 2 \sin(t\theta)$. Indeed, proceeding by induction, if $v_{t-1}^{(1)} = 2 \sin((t-1)\theta)$ and $v_t^{(1)} = 2 \sin(t \theta)$, we have:
\begin{align*}
v_{t+1}^{(1)} &= b v_t^{(1)} - v_{t-1}^{(1)}\\
&= 2 \cos (\theta) v_t^{(1)} - v_{t-1}^{(1)}\\
&= 2 \cos (\theta) \cdot 2 \sin (t \theta) - 2 \sin ((t-1) \theta) \\
&= 2\sin((t+1)\theta)
\end{align*}where the last equality is an identity which can be derived as done hereWe know:
\begin{align*}
\sin(A+B) &= \sin A \cos B + \cos A \sin B \text{ and}\\
\sin(A-B) &= \sin A \cos B - \cos A \sin B\\
\end{align*}
Summing these and re-arranging:
\begin{align*}
\sin(A+B) &= 2 \sin A \cos B - \sin(A-B)
\end{align*}
Taking $A = t\theta$ and $B = \theta$, this becomes:
\begin{align*}
\sin((t+1)\theta)& = 2 \sin(t \theta) \cos \theta - \sin ((t-1) \theta) \\
\Longrightarrow 2\sin((t+1)\theta) &= 2 \sin(t \theta) \cdot 2 \cos \theta - 2\sin ((t-1) \theta)
\end{align*}.
Then $0 = v_{n+1}^{(1)} = 2 \sin((n+1)\theta)$ so $(n+1)\theta = \pi k$ for some integer $k$. Since $\sin \theta \neq 0$, we also have that $n+1 \nmid k$. Thus, there are integers $k, l$ with $n+1 \nmid k$ such that:
\begin{align*}
b = 1 - 2\cos\left(\frac{2l\pi}{m}\right) &= 2 \cos\left(\frac{k\pi}{n+1}\right) \\
\Longrightarrow \cos\left(\frac{2l\pi}{m}\right) + \cos\left(\frac{k\pi}{n+1}\right) &= \frac{1}{2}
\end{align*}