Suppose that the variable of a mono-dimensional wave equation is an angle:
$$\frac{\partial^2 f(\phi)}{\partial \phi^2} + k_{\phi}^2 f(\phi) = 0$$
This equation is derived from a more complex (and separable) equation in cylindrical coordinates and $\phi$ is one of these coordinates. According to the definition, $0 \leq \phi < 2\pi$.
If I choose a cosinusoidal solution for $f(\phi)$, $k_{\phi}$ must be an integer.
$$\cos (\omega t - k_{\phi}\phi), k_{\phi} \in \mathbb{Z}$$
Why? Let the time $t$ be fixed and $0$. I know that the $f(\phi)$ must have for $\phi \to 2 \pi^-$ the same behaviour as for $\phi \to 0^+$, so that the function appears to be "continuous" in that point. This is possible only when the period of the function is a submultiple of $2\pi$, so $k_{\phi} \in \mathbb{Z}$.
But which could be a rigorous motivation for this?
Should the function be continuous across $\phi = 2\pi$? But this point doesn't even belong to the interval $[0,2\pi)$!
I give a proof for the statement in my comment. As $k_\phi$ does not depend on $\phi$, I set $k:=k_\phi$.
Assume $t=0$, $k=\mathbb R$ and $f(\phi)=\cos(k \phi)$. Then $$f''(\phi)=-k^2\cos(k\phi)=-k^2f(\phi).$$ Therefore, $f$ is a solution to the Helmholtz equation in $(0,2\pi)$.
Now ask in addition for $f(0)=f(2\pi)$. Then, as you argued already in the question, $f(0)=1=f(2\pi)=\cos(k 2\pi)$. This is fulfilled exactly for $k\in\mathbb Z$.