микрозадача
Aug. 29th, 2014 12:11 amThere exists exactly one Pythagorean triplet for which a + b + c = 1000. Find abc.
A Pythagorean triplet is a set of three natural numbers, a < b < c, for which, a^2 + b^2 = c^2
A Pythagorean triplet is a set of three natural numbers, a < b < c, for which, a^2 + b^2 = c^2
limit = 1000 result = head [ (prod, (x, y, z)) | x <- [1..limit], y <- [1..limit], let z = limit - x - y, z > 0, x*x + y*y == z*z, let prod = x*y*z ]