Solution (source code)

= Solution

The numbers $z_j$ are the nonzero <zeros of a function> $f$, repeated according to their <multiplicity>. The displayed <Weierstrass factorization theorem> formula uses genus-one <Weierstrass elementary factors> and a linear exponential factor; it applies under the corresponding growth assumptions, rather than to every arbitrary entire function.

Apply it to the <entire function> $g(z)=\sin(\pi z)/(\pi z)$, with its removable value $g(0)=1$. Its zeros are $\pm1,\pm2,\ldots$, each simple, and $g'(0)=0$ because $g$ is even. Pairing the factors at $n$ and $-n$ gives
$$
(1-z/n)e^{z/n}(1+z/n)e^{-z/n}=1-z^2/n^2,
$$
so
$$
\boxed{\frac{\sin(\pi z)}{\pi z}=\prod_{n=1}^{\infty}\left(1-\frac{z^2}{n^2}\right).}
$$
The product converges uniformly on compact subsets because $\sum n^{-2}<\infty$. Away from the integers its <logarithmic derivative> can be taken term by term: the resulting series also converges locally uniformly, its terms being $O(n^{-2})$. Hence
$$
\pi\cot(\pi z)-\frac1z=\sum_{n=1}^{\infty}\frac{-2z/n^2}{1-z^2/n^2},\qquad
\boxed{\pi\cot(\pi z)=\frac1z+2\sum_{n=1}^{\infty}\frac{z}{z^2-n^2}.}
$$
This is an identity of <meromorphic functions>, understood away from their poles.