13

I know there is a result that says $x^2\equiv 1\pmod{p}$ has only $\pm 1$ as solutions for $p$ an odd prime. Experimenting with $p=2$ shows that this is no longer the case. I ran a few tests on WolframAlpha, and noticed a pattern that there seem to be $4$ solutions to $x^2\equiv 1\pmod{2^a}$ when $a\geq 3$, and they are $\pm 1$ and $2^{a-1}\pm 1$. This works fine for the first several cases, but I'm wondering how you would actually prove that these are the only 4 solutions?

Jyrki Lahtonen
  • 140,891
  • 1
    http://en.wikipedia.org/wiki/Hensel's_lemma – Qiaochu Yuan Aug 02 '11 at 23:56
  • 1
    The other direction is easy but enlightening. $(2^{a-1}\pm 1)^2=2^a\pm 2\cdot2^{a-1}+1\equiv 1 \pmod{2^a}$ and it shows the other factor of $2$ comes from the cross term in the square, which is why you don't get any more as $a$ increases. – Ross Millikan Aug 03 '11 at 01:10
  • 1
    How to use Hensel's Lemma to solve this problem? $f'(x) \equiv 0 (\bmod 2)$. So I can't lift the power of $2^a$. – namasikanam Apr 20 '19 at 15:52

3 Answers3

7

In my opinion, Hensel's Lemma is a bit of overkill here. Anyway, when I teach undergraduate number theory I emphasize the connections to undergraduate algebra. Here you are trying to find the elements of order $2$ in the finite abelian group $U(2^a) = (\mathbb{Z}/2^a \mathbb{Z})^{\times}$, so it would be very helpful to know how this group decomposes as a product of cyclic groups.

This group structure is usually computed around the same time one shows that $U(p^a)$ is cyclic for all odd $p$. The answer is that for all $a \geq 3$, $U(2^a) \cong Z_2 \times Z_{2^{a-2}}$, i.e., it is isomorphic to the product of a cyclic group of order $2$ and a cyclic group of order $2^{a-2}$. See e.g. Theorem 1 here for a proof.

Can you see how to use this result to prove your conjecture?

Pete L. Clark
  • 100,402
  • I just fixed a small typo in your answer (adding a period). – Akhil Mathew Aug 03 '11 at 00:15
  • Thanks Pete L. Clark. I'm not too familiar with this, but here's what I think I gathered. I want to count all elements of order $2$ in $Z_2\times Z_{2^{a-2}}$? This is the same as the number of elements $(1,b)$ where $b$ has order $2$ in $Z_{2^{a-1}}$? But isn't $b=x^{2^{a-3}}$, where $x$ is the generator of $Z_{2^{a-2}}$ the only such element? Shouldn't I be counting 3 elements of order 2? – Joe Swanson Aug 03 '11 at 00:22
  • @Joe: close. You want all the elements of order at most $2$ in the product (of course the only element of order $1$ is the identity). It turns out that an element $(x,y)$ in a direct product has order at most $2$ iff both $x$ and $y$ have order at most $2$. – Pete L. Clark Aug 03 '11 at 00:51
  • Oops, I was just looking at elements of order $2$, not at most $2$. The 4 elements would be $(1,\pm 1)$ and $(1, \pm x^{2^{a-3}})$, so there are exactly 4 elements of order at most 2 in $U(2^a)$. Thanks, I really like this view of the problem. – Joe Swanson Aug 03 '11 at 00:59
  • 1
    @Joe: Not quite. When we switched to the notation $\mathbf{Z}2\times\mathbf{Z}{2^{a-2}}$ the group operation became componentwise addition. So the four elements of order at most 2 are $(0,0)$, $(1,0)$, $(0,2^{a-3})$ and $(1,2^{a-3})$. The isomorphism maps these back to the multiplicative group. You are correct in that in a cyclic group of even order there is only a single element of order two. But here the group is a direct sum/product of two cyclic subgroups, and you have the option to vary both components. – Jyrki Lahtonen Aug 03 '11 at 07:00
7

Hint $ $ It's easy: $\, d\ |\ x\!-\!1,\,x\!+\!1\, \Rightarrow\, d\ |\ x\!+\!1\!-\!(x\!-\!1) = 2.\,$ Thus if $\, 2^{a}\ |\ (x\!-\!1)(x\!+\!1)\:$ there are only a few ways to distribute the factors of $\,2\,$ such that $\,\gcd(x\!-\!1,x\!+\!1)\,$ is at most $\,2.$

Bill Dubuque
  • 282,220
0

More generally, it's a standard result in number theory that if $a\equiv 1\pmod8$, then $$x^2\equiv a\pmod {2^\alpha}$$ has $2^2=4$ solutions for $\alpha \ge3$.

See Vinogradov, Elements of Number Theory, Dover, p.$94$ for an even more general statement.

  • Can you provide us with the more general statement? – Daniel Donnelly Feb 23 '25 at 16:27
  • 1
    The number of Solutions is $1$ for $\alpha =1$ and $2$ for $\alpha =2.$ There's an even more general statement for $2^\alpha $ replaced by $m$ divisible by $2$ on the given page, but a little long to reproduce. It involves Legendre symbols. @DanielDonnelly – suckling pig Feb 24 '25 at 02:38