Send your feedback or ask for help here!
It is too much a Math problem with too little relationship to programming.
No way for me to digest all these Math theories from tons of unfamiliar Math writtings.
I’m just not in this field. Give up.
Continuing the discussion from [Community Puzzle] Primitive Pythagorean Triples:
An interesting little challenge.
You have to translate simple mathematical conditions using programming skills.
Hints : Pythagorean triple - Wikipedia
I don’t have the same results.
So, I took your python solution, and each time you increase the number of triplets found, I display them:
print(str(n * n) + “+” + str(m * m) + “=” + str(m * m + n * n))
And so, here is the list of the 24 triplets found for the 3rd validator:
For 9+16=25, I agree: 25 is the square of 5.
But what about the others? Their c² is not a square.
Even Pythagorean triple - Wikipedia indicates: “there are 16 primitive Pythagorean triples of numbers up to 100”.
n and m are values for euclids formula (the wikipedia page you linked has more info on this), not a and b in the pythagoras formula.
You can convert n and m into a, b and c:
- a = m * m - n * n
- b = 2 * m * n
- c = m * m + n * n.