0

Find the number of solutions of the congruence equation

$y^2 = 3x^2-x-9$ (mod $109$)

My progress: Considering myself as a beginner to these type of complex problems in Number Theory, I wonder if there is non-brute force way to find the number of solutions of this congruence. Taking granted, my knowledge in such quadratic equations is pretty low, so any suggestion or related theorems/lemmas/methods would be welcomed! Thank you very much!

3 Answers3

3

Usually you want to try something similar to completing squares. So some knowledge of quadratic residues/ reciprocity is helpful. In this case, observe that $p=109$ is prime and we can write \begin{align*} y^2 & = 3x^2-x-9 \pmod{109}\\ &=3x^2-x+\color{red}{100} \pmod{109}\\ &=\color{red}{(60)^2}x-x+100 \pmod{109}\\ y^2&=(60)^2x-\color{red}{1200}x+(10)^2 \pmod{109}\\ y^2&=(60x-10)^2 \pmod{109}. \end{align*} Using the prime property ($p | ab \implies p|a \text{ or } p|b$) we get $$y-60x+10 \equiv 0 \pmod{109} \text{ or } y+60x-10 \equiv 0 \pmod{109}.$$ Now you can count the solutions.

J. W. Tanner
  • 60,406
Anurag A
  • 41,067
  • 1
    Very nice solution indeed. I did other manipulations, but none of them worked so beautiful as yours. – BlizzardWalker May 18 '20 at 17:23
  • @DarkKnight Thanks!! – Anurag A May 18 '20 at 17:26
  • I think you meant $109$ where you typed $103 $ a couple places – J. W. Tanner May 18 '20 at 17:31
  • 1
    @J.W.Tanner Oh yes!!, thanks for pointing it out. I will fix it. – Anurag A May 18 '20 at 17:34
  • @DarkKnight Except $\ \sqrt{3} \equiv \pm60,$ was pulled out of a hat like magic. I show how to avoid any magic in my answer. – Bill Dubuque May 18 '20 at 17:57
  • @Gone In the preface, I have given the background of what is needed so one can say that I did not show all the steps but it is far from labeling it "magic". – Anurag A May 18 '20 at 18:28
  • @AnuragA My point is that you don't say how you solved $,a^2\equiv 3,\Rightarrow, a\equiv \pm60.,$ Rather, you pull the square root $,60,$ out of a hat, like magic. But magic is not math. Nothing in the "preface" explains how to compute that square root (it cannot be done merely by reciprocity) – Bill Dubuque May 18 '20 at 18:33
  • @Gone I was referring to the phrase "completion of squares" and that is what exactly you have beautifully illustrated in your solution. – Anurag A May 18 '20 at 21:18
  • Ok, in case it wasn't clear my point was to hope to coax you into explaining how you found that square root since it might be instructive to readers. But maybe you found it by computer so there is no further insight along that path. Generally there are algorithms, even though we don't need them here. – Bill Dubuque May 18 '20 at 21:25
  • @Gone In fact, I just ensured that $3$ is QR mod $109$ (reciprocity) and then proceeded exactly the way you did in your solution $2ab=...$. The reason I chose not to put the details was just to nudge OP to think about how to find it (or ask for further explanation). My intent was more pedagogical (self-discovery) and not to make math appear like magic :-) – Anurag A May 18 '20 at 21:30
  • @AnuragA It's better to be much more explicit. It's impossible from what little is written above to have any clue at all what method was used (or even that there exists some method better than computing the square root). – Bill Dubuque May 18 '20 at 21:43
0

First, note that $109$ is prime. So, you want to know when $3x^2-x-9$ is quadratic residue mod $109$. There is a whole theory about quadratic residues mod $p$ prime (look for Legendre symbol).

For this particular problem, we first try to complete the square, we multiply the equation by 12 to try to complete squares in the right hand side (since 12 is coprime with 109, this equation is equivalent to the original one). We get: $$12y^2=36x^2-12x-108 \pmod{109}$$ Luckily, the right hand side is in fact a perfect square mod 109,

$$12y^2=36x^2-12x+1=(6x-1)^2\pmod{109}$$ So, you have $$3(2y)^2=(6x-1)^2\pmod{109}$$ If $y=0\mod 109$, then $6x-1=0\bmod 109$, so you get one solution $(x,y)=(91,0)\pmod{109}$

If $y\neq 0\bmod 109$, then that would imply that $3= [(6x-1)(2y)^{-1}]^2\bmod 109$, i.e. $3$ would be a quadratic residue mod $109$. Is this possible? Let's see, by quadratic reciprocity, we have $$\left(\frac{3}{109}\right)=\left(\frac{109}{3}\right)=\left(\frac{1}{3}\right)=1.$$ So, yes, 3 is a quadratic residue mod $109$. You will have two square roots of $3\pmod{109}$, say $a$ and $-a$.

So, you have $ (6x-1)(2y)^{-1}=a\pmod{109}$, which will give you 108 solutions (for each value of $y$, you have a unique value of $x$. And similarly $ (6x-1)(2y)^{-1}=-a\pmod{109}$, gives you another 108 solutions.

In total, you will get $1+108+108=217$ solutions $(x,y)$ mod $109$.

Edit

1)Whenever you want to complete squares an expression like this $S=mx^2+nx$ with $m,n$ integer. Multiply the expression by $4m$ (in fact you only need to multiply it by $m$ if $n$ is even). Because in that way, you would have $$4mS=4m^2x^2+4mnx=(2mx+n)^2-n^2$$. That's why in the problem we multiply the equation by $4(3)=12$, to make the completion of squares.

2) Note in this solution I never needed to compute a square root mod 109. Although, something to point out, that I already mentioned, is that we really really got lucky to have a perfect square on the right hand side. If this wasn't the case, say instead we got $3(2y)^2=(6x-1)^2+2\pmod{109}$, then this would be painful since we would need to find two quadratic residues ($3(2y)^2$ and $(6x-1)^2$ ) whose difference is $2$. And I don't really see a way to count the solutions in an easy way.

Julian Mejia
  • 4,438
  • But you pulled the crucial scale factor $12$ out of a hat, like magic. Such magic won't work in general. See my answer for one way to avoid any magic. – Bill Dubuque May 18 '20 at 18:41
  • It's not magical at all. As I said, I just wanted to complete squares, the issue is that you need integers. You have $3x^2-x-9$. First you want to make the quadratic part an square, so technically you could have done it just by multiplying by $3$ (instead of 12), so you could have $9x^2-3x-27$. The "issue" is that now this becomes $(3x-1/2)^2-27-1/4$. This still makes sense since 2 is invertible mod 109, but I just wanted to express everything with integer coefficients, so that's why I multiplied everything by 4. (So in total I multiply by a factor of 12). – Julian Mejia May 18 '20 at 23:33
  • In other words, I just tried to multiply the equation so that something as $a^2x^2+2ab x$ appears. (which is what appears from expanding $(ax+b)^2$ as in your solution.) In general if I had $mx^2+nx$ in one side of the equation, I would have multiplied it by $4m$, so that I get $4m^2x^2+4mnx=(2mx+n)^2-n^2$. – Julian Mejia May 18 '20 at 23:42
0

Without any magic: $\bmod 109\!:\ 3x^2\color{#c00}{-1}\,x\,\overbrace{-\,9}^{\large\color{#0a0}{ 10^2}} \equiv (ax+b)^2 \equiv a^2\, x+ \color{#c00}{2ab}\,x+\color{#0a0}{b^2}$

yields $\,\color{#0a0}{b^2\! \equiv 10^2},\,$ wlog $\,b\!\equiv\!10,\,$ so $\, \color{#c00}{2ab \equiv -1}\,$ $\Rightarrow\, 20b\equiv108\!\iff\! b \equiv \dfrac{27}5\equiv \dfrac{27\cdot 22}{110}\equiv \dfrac{49}1$

Further $\,a^2\equiv49^2\equiv 3\ $ so $\,a \equiv 49,\, b\equiv 10\,$ works. The rest is straightforward.

Bill Dubuque
  • 272,048
  • We computed the fraction by Gauss's algorithm $\ \ $ – Bill Dubuque May 18 '20 at 17:54
  • or you could have said $20b\equiv108\iff5b\equiv27\equiv136\equiv245\iff b\equiv49$ – J. W. Tanner May 18 '20 at 17:57
  • @J.W.T Yes, that essentially uses inverse reciprocity. It's just as quick mentally by Gauss's algorithm because $,\color{#c00}{5\cdot 22\equiv 1},\Rightarrow, 27(22)\equiv (2+5\cdot\color{#c00}5)\color{#c00}{22}\equiv 2\cdot\color{#c00}{22}+5\cdot\color{#c00}1\equiv 49\ \ \ $ – Bill Dubuque May 18 '20 at 18:12
  • Well, the real magic is that you are assuming that the expression $3x^2-x-9$ can be expressed as $(ax+b)^2$. Which a priori we don't know. We just got lucky that the problem was proposed in a way such that this is the case. – Julian Mejia May 19 '20 at 00:18
  • @Julian Testing if a (polynomial) is a square by the method of undetermined coefs is (standard) math, not magic. – Bill Dubuque May 19 '20 at 00:29
  • I meant that it's magical that everything works out. Although it's actually not coincidence, it's clear that the question was made in that way by purpose. Because, I really don't think the problem is doable easily if the right hand side is not a perfect square. – Julian Mejia May 19 '20 at 06:16