-1

Solve Diophantine equation $a^2+5ab+3b^2-c^2=0$

My thoughts are to express it as $(pa+qb)^2 = c^2 $and then solve it as Pell's equation.

One solution is $(1,9,17)$.I don't know whether it is a fundamental solution or not, since I haven't yet figured out the arrangement into pell's equation form.

sibillalazzerini
  • 470
  • 2
  • 10

2 Answers2

4

Consider rational solutions to:

$$x^2+5xy+3y^2=1.\tag1$$

We have $(-1,0)$ is a rational solution.

If $p,q$ are relatively prime integers, there are usually two values $t$ such that $(-1+pt,qt)=(-1,0)+t(p,q)$ is a solution, one with $t=0.$

$$\begin{align}0&=(-1+pt)^2+5(-1+pt)qt+3(qt)^2-1\\&=-2pt+p^2t^2-5qt+5pqt^2+3q^2t^2\\&=t(\left(p^2+5pq+3q^2)t-(2p+5q)\right) \end{align}$$

So $t=0$ or $t=\frac{2p+5q}{p^2+5pq+3q^2}.$

The. $$(x,y)=\left(\frac{p^2-3q^2}{p^2+5pq+3q^2},\frac{2pq+5q^2}{p^2+5pq+3q^2}\right)$$

And you get $$(a,b,c)=(p^2-3q^2,2pq+5q^2,p^2+5pq+3q^2).\tag2$$

If $(p,q)=(2,1)$ you get your solution $(1,9,17).$

This won't give primitive solutions, in general. When $(p,q)=(5,-2)$ then $(a,b,c)=(-13,0,-13),$ for example.

If $\gcd(p,q)=1,$ we can show $\gcd(a,b)=1$ or $13.$ It can only be $13$ if $p\equiv 4q\pmod{13}.$


This finds all solutions because there is no non-zero solutions with $c=0.$ This is because, for integers $a,b:$

$$(2a+5b)^2-13b^2=4(a^2+5ab+3b^2)\neq 0$$ unless $(a,b)=(0,0).$


You can get all primitive roots from $p,q$ with $\gcd(p,q)=1$ by using $(2)$ if $p\not\equiv 4q\pmod{13}$ and using $$(a,b,c)=\left(\frac{p^2-3q^2}{13},\frac{2pq+5q^2}{13},\frac{p^2+5pq+3q^2}{13}\right)\tag{3}$$ when $p\equiv 4q\pmod{13}.$ $(3)$ is just $(2)$ with the common factor of $13$ factored out.

Thomas Andrews
  • 186,215
-2

As @thomas-andrews pointed out it can be expressed as

$(2a + 5b)^2 -13b^2 = (2c)^2$

which is generalised Pell's equation form $x^2 -dy^2 = N$

which we can tackle by say Lagrange's algorithm of generalized pell's

PS: Computationally speaking I am not sure whether iterating over all $p,q$ in eq 2 of @thomas-andrews is more efficient or solving $c$ number of generalized pell's equations. Will update the answer once I have the clarity.

sibillalazzerini
  • 470
  • 2
  • 10
  • 1
    $u^2-13v^2=w^2$ has an easier approach to $u^2-13v^2=N,$ because it can be written as: $$(u-w)(u+w)=13v^2.$$ Then you can parameterize $v=v_0v_1v_2$ where $v_0v_1^2=u-w, 13v_0v_2^2=u+w,$ and solve for $u,w.$ – Thomas Andrews Jan 22 '23 at 09:48
  • why not $13v_0v_i^2=u-w$, $v_0v_2^2 = u + w$ as well? – sibillalazzerini Jan 22 '23 at 16:13
  • That's the same as $13v_0v_1^2=u+(-w)$ and $v_0v_2^2=u-(-w).$ So you get all the solutions just by considering the first, up to a sign. – Thomas Andrews Jan 22 '23 at 17:23
  • This is the most cost efficient solution that you suggested. computationally speaking iterating over all v from 1 to N and then factorising and then "Multiplicative partitioning"(which in your terms is parameterizing) will do the job. – sibillalazzerini Jan 23 '23 at 01:47
  • In fact we might not have to iterate over all v from 1 to N, iterating over all v from 1 to $^{1/2}$ and then extending those successful solutions with squared numbers in $(1/2,/]$ might suffice. something similar to "exact" prime counting functions – sibillalazzerini Jan 23 '23 at 01:48
  • This solution would have computational complexity of $O(N^{1/2}N^{1/4}log^2 N)$ which would suffice but still for Thomas Andrew's satisfaction of this question having "issue for asking for a better solution" I created a new question which clearly asks for a better solution than his, and that has been linked above. – sibillalazzerini Jan 23 '23 at 05:40