I have the equation $x^2+xy+y^2=z^2$ to solve it in natural numbers.
The discriminant of it $D=4z^2-3y^2$ and must be perfect square.
I wrote Python program to get solutions for $1<x<100$ by enumeration.
def Solution():
A=[]
nMaximum=10**2
for x in range(1,nMaximum):
dTemp1a=3*x**2
for z in range(x+1, nMaximum):
dDiscriminant=4*z**2-dTemp1a
dTemp5=int(dDiscriminant**0.5)
if dTemp5**2!=dDiscriminant:
continue
dTemp6=(-1*x+dTemp5)/2
y=int(dTemp6)
if not CheckIfExists(A, z):
A.append([x,y,z])
return A
def CheckIfExists(arr, z):
bResult=False
for s in arr:
if s[2]==z:
bResult=True
break
return bResult
a = Solution()
print(len(a))
print(a)
[3, 5, 7], [5, 16, 19], [6, 10, 14], [7, 8, 13] ...
Three variable, second degree diophantine equation doesn't explain how to get other solutions when we know the first solution $(3,5,7)$
Could you give me a hint ?
UPDATE asked by Shean: I need to get all solutions based on $(3,5,7)$. See my question as the example of what I am looking for:
or see these formulas for all solutions of Pell's equation