1

How to solve congruence $x^2-2 \equiv 0\pmod a$, $x$ and $a$ are integers, and $a$ mustn't be prime? I have found solution when a is prime, but I haven't found solution for general case.

Stefan4024
  • 35,843

1 Answers1

3

Building on the comments, a strategy might be the following.

  1. Check that the congruence has a solution modulo all prime divisors $p$ of $a$. If there is no solution even for a single such prime $p$, the congruence itself has no solution. For this, you may use quadratic reciprocity.
  2. Assuming there are solutions for each such $p$, find them, and use Hensel lifting to get a solution modulo each prime power $p^{e}$ such that $p^{e}$ divides $a$, but $p^{e+1}$ does not.
  3. Use the Chinese Remainder Theorem to glue all these solutions together.