Let $a$ be an odd integer. And $L \geq 1$. I would like to know the number of solutions modulo $2^L$ to the congruence $$ x^2 \equiv a \pmod {2^L}. $$ Is it possible to conclude that there is number $C> 0$ such that the number of solutions modulo $2^L$ to the congruence is at most $C$ for any $L$? Thank you.

- 60,406

- 2,897
-
1if $x^2\equiv a\bmod 2^L$, then $(-x)^2\equiv a\bmod 2^L$ and $(2^{L-1}\pm x)^2\equiv a\bmod 2^L$ – J. W. Tanner Apr 07 '20 at 14:12
2 Answers
Hint: if $x^2 - 1 = (x+1)(x-1)$ is divisible by $2^L$ with $L \ge 3$, exactly one of $x+1$ and $x-1$ is divisible by $2^{L-1}$.

- 448,999
Let us trace along an argument inspired by the proof that $a \equiv 1 \pmod{8}$ has square roots in $\mathbb{Z}_2$, in order to find out the number of square roots $\pmod{2^L}$.
First, since $a$ is odd and is a square, we know that if $L \ge 3$, then $a \equiv 1 \pmod{8}$; say $a = 8b + 1$. Then for $n^2 \equiv a \pmod{2^L}$, we must have $n$ odd, say $n = 2m + 1$. Then \begin{align*} (2m+1)^2 \equiv 8b+1 \pmod{2^L} & \Leftrightarrow 4m^2 + 4m + 1 \equiv 8b+1 \pmod{2^L} \\ & \Leftrightarrow m^2 + m \equiv 2b \pmod{2^{L-2}}. \end{align*} Now, by Hensel's lemma, since $p(x) = x^2 + x$ is a polynomial with $p(0), p(1) \equiv 0 \equiv 2b \pmod{2}$ and $p'(0), p'(1) \equiv 1 \pmod{2}$, for any given $b$, there are exactly two solutions of $m^2 + m \equiv 2b \pmod{2^{L-2}}$ for $m \pmod{2^{L-2}}$: one with $m$ even, and one with $m$ odd. Now, each of these two solutions determines $n \pmod{2^{L-1}}$; we thus get at most 4 solutions $\pmod{2^L}$.
(And in fact, this reflects the comment by J. W. Tanner that if $n$ is a solution, then the general solutions are $\pm n$ and $2^{L-1} \pm n$. To see this, note that if $m_0$ is one of the roots of $m^2 + m \equiv 2b \pmod{2^{L-2}}$, then $-1 - m_0$ is also a root. This also implies there are exactly 4 solutions in all cases with $L \ge 3$, since $n$ odd and $L \ge 3$ implies all these values are distinct.)

- 20,364
-
Great answer. OP maybe may compare with https://math.stackexchange.com/a/2299228/96384 to see how during the Hensel lifting "all the way up to $p^\infty$", in each step two of the four solutions get singled out as the compatible ones, so that in the $2$-adics there are still only two, not four, solutions. – Torsten Schoeneberg Apr 07 '20 at 17:27