Solution (source code)

= Solution

For
$$
w''+p(z)w'+q(z)w=0,
$$
a finite point $z_0$ is an <ordinary point criterion for a second-order equation>[ordinary point] exactly when $p$ and $q$ are <holomorphic function>[holomorphic] there. It is a <regular singular point criterion for a second-order equation>[regular singular point] exactly when
$$
(z-z_0)p(z)
\quad\hbox{and}\quad
(z-z_0)^2q(z)
$$
are holomorphic at $z_0$.

Put $\zeta=1/z$ and $W(\zeta)=w(1/\zeta)$. Direct differentiation gives
$$
w'=-\zeta^2W',
\qquad
w''=\zeta^4W''+2\zeta^3W',
$$
so the transformed equation is
$$
W''+\left(\frac2\zeta-
\frac{p(1/\zeta)}{\zeta^2}\right)W'
+\frac{q(1/\zeta)}{\zeta^4}W=0.
$$
Consequently $z=\infty$ is ordinary precisely when
$$
\frac2\zeta-\frac{p(1/\zeta)}{\zeta^2}
\quad\hbox{and}\quad
\frac{q(1/\zeta)}{\zeta^4}
$$
are holomorphic at $\zeta=0$. It is a <regular singular point at infinity> precisely when $zp(z)$ and $z^2q(z)$ are holomorphic functions of $1/z$ near infinity.

If zero and infinity are regular singular and every nonzero finite point is ordinary, the <Laurent series> of $p$ and $q$ can contain only the terms compatible with both endpoint bounds. Hence
$$
\boxed{p(z)=\frac az,
\qquad q(z)=\frac b{z^2}}
$$
for constants $a,b$. The equation is a <Cauchy-Euler differential equation>. Its indicial equation is
$$
\lambda(\lambda-1)+a\lambda+b=0.
$$
For distinct roots $\lambda_1,\lambda_2$, the general solution on a domain with a chosen logarithm branch is
$$
w(z)=C_1z^{\lambda_1}+C_2z^{\lambda_2}.
$$
For a repeated root $\lambda$, the <general solution of an Euler-Cauchy equation> is
$$
w(z)=z^\lambda(C_1+C_2\log z).
$$

Finally require infinity to be ordinary. In the transformed equation its coefficients become
$$
\frac{2-a}{\zeta},
\qquad
\frac b{\zeta^2}.
$$
Both are holomorphic at zero exactly when $a=2$ and $b=0$. Thus the further restriction is
$$
\boxed{p(z)=\frac2z,
\qquad q(z)=0.}
$$