funny, ur method seems so familiar to mine esp after u read my message for help...
anyway, no one replied to my post (all my own posts ), but i posted in my message one way to do it using dynamic programming, u may like to refer to it.
the idea is to make the loop dependent on z instead of x or y where x^2 + y^2 = z^2 since we know z>x and z>y, using this info we can be sure we can build our result based upon a previous result of z
i was thinking... what if i instead of iterating through all possible numbers from 0 to N, i generate a list of numbers to go through. this list of number would have all the multiples of the previously generated triples struck out as we know these are confirmed cases. that would have leave us a ...
Currently I am working on problem 106 and using the following method:
x^2 = z^2 - y^2 x^2 = (z + y)(z - y) let a = z + y if x^2 is divisible by a, x^2 = ab where b is the other root also since (z + y) - (z - y) = 2y (z + y) + (z - y) = 2z
therefore if a + b is divisible by 2 then we can get z ...