Solution (source code)

= Solution

For $f(X)=X^2-X-2m$, $f(0)\equiv0\pmod2$ and $f'(0)\equiv1\pmod2$. Hensel's lemma gives $x\in\mathbb Z_2$ with $x^2-x=2m$, hence
$$
(2x-1)^2=1+8m.
$$

For $v=\infty$, signs give two square classes and $4/|2|_\infty=2$. For odd $p$, parity of $v_p$ gives two classes and $\mathbb F_p^*/(\mathbb F_p^*)^2$ gives two more, while Hensel makes every unit congruent to $1$ modulo $p$ a square; hence there are four. For $p=2$, valuation parity gives two classes and odd units modulo squares are represented by $1,3,5,7\bmod8$, giving eight. Thus in every case
$$
|\mathbb Q_v^*/(\mathbb Q_v^*)^2|=\frac4{|2|_v}.
$$

Solved by gpt-5.6-sol high.