0

I'm trying to understand how to know the numbers of solutions for x^2=a(mod m). I know that if a has roots they are solutions but how could I know the rest of them? Is there a need to use the Chinese reminder here? if so how?

2 Answers2

0

I think I got it: I dismantle m to coprime numbers and check when the x^2=a(mod m) have solutions for each. lets say x^2=11^2(mod 1800) so it has solutions if and only if

x^2=11^2(mod 9)=4(mod 9)

x^2=11^2(mod 8)=1(mod 8)

x^2=11^2(mod 25)=21(mod 25)

Because 1800=9*8*25

x=+-2(mod 9)

x=+-1,+-3(mod 8)

x=+-11(mod 25)

so it has 2*4*2=16 solutions, is it right?

0

First, you want to know whether there are solutions: that's where the Legendre symbol comes in; there is a solution to $x^2\equiv a$ mod $m$ iff $\left(\frac{a}{m}\right)=1$. How to compute this Legendre symbol? Well, there are some fine tricks, one of them being the law of quadratic reciprocity.

After finding out it has a solution, one can find solutions the hard way by trying all numbers $1,2,3,\ldots,\lceil m\rceil$. Note that you don't have to checke the other half since if $a$ mod $m$ is a solution, then also $a-m$ mod $m$ is a solution.

There are more methods for finding the solutions but it all comes down to first checking the existence of a solution. For finding all solutions with less work, one can use Tonelli's algorithm, but you need to know about Legendre symbols and Jacobi symbols first.

You may find this post interesting: Number of solutions to $x^2\equiv a\pmod m$

Algebear
  • 1,742
  • Thanks. I am aware of this but is works only if m is odd(at least I only learned Legendre symbol where m is odd). I asked this question because I got stuck on where m is even – Idan Daniel May 25 '19 at 16:27
  • @IdanDaniel Jacobi symbols are the extension of Legendre symbols and they deal with the cases where $m$ is not prime. – Algebear May 25 '19 at 16:28
  • I know. My professor only defined it for odd numbers though. – Idan Daniel May 25 '19 at 16:30
  • @IdanDaniel I should have looked better, but indeed it is defined for positive odd numbers only. – Algebear May 25 '19 at 16:32
  • 1
    Note also that for Jacobi symbols, $\left(\frac{a}{b}\right)=-1$ tells you that $a$ is not a square modulo $b$, but if it is equal to $1$, it is still possible for $a$ to also not be a square modulo $b$. For example, that happens with $-1$ modulo $77$. – Arturo Magidin May 25 '19 at 17:15