Solution (source code)

= Solution

We count extensions up to $K$-isomorphism. An extension of degree $n$ has a maximal <unramified extension> $E/K$ inside it, with $[E:K]=f\mid n$, and $L/E$ is <totally ramified> of degree $e=n/f$. The unramified extension of each degree is unique, so there are only finitely many possibilities for $E$.

Fix $E$ and $e$. The coefficient space of monic degree-$e$ <Eisenstein polynomials> is compact: its nonconstant nonleading coefficients lie in the compact <maximal ideal>, and its constant coefficient lies in the compact set $\mathfrak m_E\setminus\mathfrak m_E^2$. Each such polynomial $F$ has a root $\alpha$ generating a degree-$e$ extension. For sufficiently close coefficients of a polynomial $G$, the numbers $G(\alpha)$ and $G'(\alpha)-F'(\alpha)$ are arbitrarily small, while $F'(\alpha)\ne0$ because the characteristic is zero. The <strong form of Hensel lemma>, applied in $E(\alpha)$, supplies a root $\beta$ of $G$ as close to $\alpha$ as desired. Choose the neighborhood so that the <Krasner's lemma> inequality holds. Then $E(\alpha)\subseteq E(\beta)$, and both degrees are $e$, so the extensions are equal. Compactness gives a finite cover by such neighborhoods, proving \b[finiteness of degree-$n$ extensions]. If extensions are realized as subfields of a fixed algebraic closure rather than counted up to isomorphism, each has only finitely many embeddings, so that count is finite too.

For odd $p$, write $K^\times=\pi^{\mathbb Z}\mathcal O_K^\times$. The square map is bijective on $1+\mathfrak m_K$ by <Hensel lemma>, and the finite <residue field> has cyclic multiplicative group of even order. Thus
$$
K^\times/K^{\times2}\cong(\mathbb Z/2\mathbb Z)^2.
$$
The <quadratic extensions from square classes> correspond to its three nontrivial classes. Representatives are $u,\pi,u\pi$, where $u$ is a unit with nonsquare residue. \b[There are $\boxed{3}$ <quadratic extensions>: $K(\sqrt u)$ is unramified, while $K(\sqrt\pi)$ and $K(\sqrt{u\pi})$ are totally ramified.] For completeness, two nonsquare parameters give the same extension only if their ratio is a square: writing $\sqrt b=x+y\sqrt a$ and squaring forces $x=0$, hence $b/a=y^2$.