I want to find integers x,y,z, such that
k$z^2$ = $x^2$ - $y^2$
for a given integer k.
How do I write down the set of solutions? Preferably in parametric form.
For a given z, finding all the x and y is not difficult, I can just list the factors of k$z^2$ and use the factorisation (x+y)(x-y) = $x^2$ - $y^2$ to solve for x and y. So in principle, I can find all the solutions for z = 1,2,3,... There must be a clever way.
Put it in this form,
$$y^2+kz^2 = x^2$$
Given the basic identity,
$$(m^2-v^2)^2+(2mv)^2=(m^2+v^2)^2$$
Let $v = n\sqrt{k}$. So,
$$(m^2-kn^2)^2+k(2mn)^2=(m^2+kn^2)^2$$
where $k=1$ gives you the Pythagorean triples.