1

When finding whether there exists a solution for $x^2 \equiv a \pmod n $, one way is to calculate it with the Jacobi symbol. However, Jacobi symbol requires that $(a,n) = 1$. So I wonder when $(a,n) \neq 1$, will there also be a similar method to determine whether the solution exists or not.

Here's what I've tried:

Write n as $p_1^{k_1}p_2^{k_2}\ldots p_n^{k_n}$ and then $a$ must have a common factor. Assuming $a$ only has a common factor of $p_s^m$ while $p_s^{m+1}$ is not its factor. Let $d = {a \over p_s^m}$. Then we can use the Chinese remainder theorem to separate the part $x^2 \equiv p_s^m d \pmod {p_s^{k_s}}$ out, and the rest can be dealt with the Jacobi symbol. If there exist more common factors, then separate each of them out in the same manner.

So the problem reduces to $x^2 \equiv p_s^m d \pmod {p_s^{k_s}}$. And I'm close to being stuck. One way I thought about is to reduce $p_s^{k_s}$ to a lower power such as $p_s$ itself. As long as we can find a non-zero solution, we can use Hensel's lifting to find a solution that satisfies the original equation. Also if m is somehow even, we can reduce the problem to find whether there exists a solution such as $y^2 \equiv d \pmod {p_s^{k_s}}$. However, we can not assume it's even, so I'm also stuck.

I have spent a long time searching online for a solution but have not found anything appertaining to this question. I wonder why the Jacobi symbol is limited to relatively prime numbers. Is it too trivial to explain the case when they are not? So if they are not relatively prime, what techniques can we use to check whether a solution exists?

Thanks in advance.

wsz_fantasy
  • 1,672
  • You need more than just Jacobi sysmbols to decide solvability - see here. – Bill Dubuque Feb 12 '22 at 08:36
  • @BillDubuque Thank you, I'm aware that the Jacobi symbol is insufficient to decide solvability. However, we can conclude that there's no solution when the Jacobi symbol equals -1. – wsz_fantasy Feb 12 '22 at 16:26

1 Answers1

1

I’ve left a lot of steps out, but this is the gist.

Let $d=\gcd(a,n)$ and let $d_0$ be the smallest value such that $d\mid d_0^2.$ Then show $x=d_0x_0$ for some $x_0,$ and you need $$(d_0^2/d)x_0^2\equiv \frac{a}{d}\pmod{n/d}.$$

Now, since $\gcd(a/d,n/d)=1,$ we require $\gcd(d_0^2/d,n/d)=1,$ or $\gcd(d_0^2,n)=d.$

So solve $d_0^2u+nv=d.$ Then you need a solution to: $$x_0^2\equiv \frac{au}d\pmod {n/d},$$ where $\gcd(\frac{au}d,\frac nd)=1.$ So you’ve reduced to the case where $(n,a)=1.$

Thomas Andrews
  • 177,126
  • Thank you for your help. Do you mean that $x_0^2\equiv \frac{au}d\pmod {n/d}$ exists a solution iff the original equation exists a solution or is it only a necessary condition? Also, I'm not very clear with a few steps, so would you mind editing it and including some of the details? For example, would you mind elaborating on why $d_0$ must divide x? – wsz_fantasy Feb 12 '22 at 16:14
  • If $x_0^2\equiv au/d\pmod{n/d}$ then $(d_0x_0)^2\equiv a\pmod n,$ yes. so it is necessary and sufficient that $u$ and $x_0$ exist. @wsz_fantasy – Thomas Andrews Feb 12 '22 at 16:30
  • And if $x^2 \equiv a \pmod n$ then there exist a $x_0$, such that $x_0^2 \equiv {au}/d \pmod {n/d}$? I'm still a little bit confused, would you mind elaborating and including the steps? – wsz_fantasy Feb 12 '22 at 16:49
  • No, not going to give the entire answer. – Thomas Andrews Feb 12 '22 at 17:47