I want to find solution in $\mathbb{Z}$ to the following quadratic Diophantene equation:
$$na^2 + kb^2 = c^2$$
where $n,k,a,b,c \in \mathbb{Z}$, $n,k > 0$ and $(n,k) = 1$
I know that for some this won't work for all values of $n$ and $k$ that satisfy the upper condition, but anyone know what will be the condition, so the Diophantene equation will have integer solution.
My second question is: "Let the equation have integer solution for some values of $n$ and $k$, is there infinite amount of them or their numbers is finite?"
And my third and last question is how to solve this type of equation. I'll give you one specific example:
$$19a^2 + 5b^2 = c^2$$
I don't know whether this equation has integer solution, but I hope it have because I found it in a book and it says: "Solve this equation in $\mathbb{Z}$". And if there is a infinite amount of solution is there any general formula to generate them?
I decided to try using congruence, because I suspect there is a "by-the-book" way to solve this, so we must make some restriction, but I didn't make a progress.
As I said I suspect there is a "by-the-book" way to solve this type of equation, but any method (e.g. congruence relations) would be helpful.
For $$ 19 a^2 + 5 b^2 = c^2, $$ there are infinitely many.
Let $u,v$ be any integers, then take $$ a = 2 u^2 + 2 u v - 2 v^2, \; \; b = u^2 - 8 u v - 3 v^2, \; \; c = 9 u^2 + 4 u v + 11 v^2. $$ If $\gcd(u,v) = 1$ and $u,v$ are not both odd, then $a,b,c$ might be relatively prime.
To get both $a,b$ odd while $c$ is the one that comes out even, $$ a = u^2 + 4 u v - v^2, \; \; b = -5u^2 + 4 u v + 3 v^2, \; \; c = 12 u^2 - 2 u v + 8 v^2. $$
Those two recipes together give you all primitive solutions, that is $\gcd(a,b,c) = 1.$ To get other solutions, multiply through by a number. For example, these recipes do not give $a=14,b=21,c=77.$ However, they do give $a=2,b=3,c=11,$ then you multiply all by $7.$
The essential condition is that your form lie in the principal genus. The form $\langle 5,0,19 \rangle$ is indeed in the principal genus, of binary quadratic forms, for discriminant $-380.$ In the class group, it is the square of $\langle 9,4,11 \rangle$ and the square of $\langle 9,-4,11 \rangle.$ I learned from a large number of books; I recommend Binary Quadratic Forms by Duncan A. Buell, Binary Quadratic Forms by Buchmann and Vollmer, Primes of the Form $x^2 + n y^2$ by David A. Cox. Buell's book gives careful algorithms for composition, which is the topic here. Indeed, let's display that, it is how I solved the problem, $$ \langle 9,4,11 \rangle^2 = \langle 5,0,19 \rangle $$ in the group of equivalence classes of positive (primitive) forms of this discriminant.
I did not initially notice that there needed to be a way to generate primitive solutions with $a$ odd and $c$ even. I fiddled a bit, the result uses the "imprimitive" form $\langle 8,2,12 \rangle$ near the beginning of the output below. The class number is $8.$ There are four classes in the principal genus, the list below called "squares."
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Anyway, easy enough to print out just the PRIMITIVE solutions. I took a,b positive and up to 1100. I had to repeat the value of c as both the first and fourth column, to allow the computer to sort by size of c without extra work on my part.
19 a^2 + 5 b^2 = c^2
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=