3

Say I have the formula $$k^2 \equiv b^2 - 4ac \pmod n$$ where are variables are integers and $n$ is odd. So then my question is, if $b^2-4ac$ and $n$ are constant, when is there never a $k$ that will satisfy this?

I know this has to do with quadratic residues and that for odd prime $n$, $b^2-4ac$ must satisfy Euler's criterion for $k$ to exist, but can anything be said for the general case of odd $n$. I am looking to find properties of $a, b,$ and $c$ that must be true in order for $k$ to exist for odd $n$.

Will Fisher
  • 5,112
  • 3
    Depends on the prime factorization of $n$. Such a $k$ exists if and only if $b^2-4ac$ is a quadratic residue for all prime factors $p_i$ of $n$. If there is a solution modulo an odd prime $p$, then Hensel lifting allows you to find suitable $k$ modulo $p^2$, $p^3$ et cetera. Do this for all prime power factors for $n$. Then Chinese remainder theorem allows you to combine modulo $p_i^{a_i}$ solutions to a solution modulo $n$. – Jyrki Lahtonen Jan 08 '16 at 20:05
  • See this answer by yours truly. There I show how to find such a $k$ when $b^2-4ac=-1$ and $n=17\cdot13^2$. Sorry about the quality. The OP asked a lot of questions, several edits were needed, and it all became a bit of a patchwork. – Jyrki Lahtonen Jan 08 '16 at 20:36
  • @JyrkiLahtonen Thanks for the response! I will definitely look in to that. Also do you mind showing a link to or giving the name of the property that for $k$ to exist, $b^2-4ac$ must be a quadratic residue of all $n$'s prime factors? – Will Fisher Jan 09 '16 at 00:01
  • If $p\mid n$ is a prime factor, and $k^2\equiv b^2-4ac\pmod n$, then $k^2\equiv b^2-4ac\pmod p$. So the necessity of the latter congruence having a solution (for all such $p$) is kinda clear. The somewhat surprising fact is that this condition is also sufficient, when $\gcd(n, b^2-4ac)=1$ and $n$ is odd. I did forget to emphasize that you should first check that $\gcd(n,b^2-4ac)$ is a square. If it isn't there cannot be any solutions. If it is, you can cancel that gcd, and then work as above. – Jyrki Lahtonen Jan 09 '16 at 06:24

0 Answers0