3
$\begingroup$

It is well known that if $n$ is an odd prime, then the equation $x^2=1$ has exactly two solutions in $\mathbb{Z}/n\mathbb{Z}$, namely $-1$ and $1$ (or, to be precise : the congruent class of $1$ modulo $n$ and its opposite).

Conversely, this can be true even if $n$ is not an odd prime. For example : $n=6$, or $n=9$ or $n=10$.

There are $24$ such values between $2$ and $100$.

My question :

What is a necessary and sufficient condition under which the equation $x^2=1$ has exactly two solutions in the ring $\mathbb{Z}/n\mathbb{Z}$ ?

My conjecture :

Numerical evidence, for $n\le 1000$, suggests that a N&S condition should be that $n$ has no more than two prime factors. Would it be true ? If so, how to prove it ?

Thanks.

  • 1
    The decomposition theorem for abelian groups might be useful here.2017-02-24
  • 0
    I think this is [a duplicate of this older question](http://math.stackexchange.com/q/385857/11619) (and many others, this was from the list of related questions in the right margin).2017-02-24
  • 1
    Your conjecture fails already at $n=15$, which has solutions $x=\pm 1,\pm 4$. Also $n=35,143,323,899,\ldots -$ do you see the pattern?2017-02-24
  • 0
    @TonyK: Yes, of course. I think I see, using chinese theorem, what happens. The equation has exactly two solutions in $\mathbb{Z}/n\mathbb{Z}$ iff $n=p^\alpha$ or $n=2p^\alpha$ with $p$ prime and $\alpha\ge1$ or $n=4$. Right ?2017-02-24
  • 0
    I think that's right $-$ it seems to agree with @Jyrki's link. (But you didn't get that from my examples, which are all of the form $p(p+2)$ with $p$ and $p+2$ both prime.)2017-02-24

1 Answers 1

2

HINT $n=ab, a>1, b>1$, $a$ and $b$ is coprime => $solutions(n)=solutions(a)solutions(b)$

Lemma1 Let $p$ is odd prime, $n$ is integer, $m=p^n$.

$x^2 = 1$ has 2 solutions in $Z/mZ$ (just induction)

Lemma2 $m=2^n$

$x^2 = 1$ has 1 solutions in $Z/mZ$ if $n=1$, 2 solutions if $n=2$, else 4 solutions (just induction)

  • 1
    Lemme 2 is false. The correct version should probably be : $1$ sol if $m=2$, $2$ sols if $m=4$ and $4$ sols if $m=2^n$ with $n>2$2017-02-24
  • 0
    @Adren, mea culpa, fixed2017-02-24
  • 1
    @kotmord: Hmmm ... not yet fixed :)2017-02-24