Taken from Project Euler (an epic site btw), this is mainly for the programmers out there, although if you can solve it using a pen and paper, good show.
A Pythagorean triplet is a set of three natural numbers, a < b < c, for which, a2 + b2 = c2
For example, 32 + 42 = 9 + 16 = 25 = 52.
There exists exactly one Pythagorean triplet for which a + b + c = 1000. Find it.
I wrote a quick computer program (in Java) that solves the problem in less than a second 124ms (I just put it through a profiler).
A Pythagorean triplet is a set of three natural numbers, a < b < c, for which, a2 + b2 = c2
For example, 32 + 42 = 9 + 16 = 25 = 52.
There exists exactly one Pythagorean triplet for which a + b + c = 1000. Find it.
I wrote a quick computer program (in Java) that solves the problem in less than a second 124ms (I just put it through a profiler).