Project Euler Problem Nine
The ninth Euler Problem is currently the one I have solved with the fewest lines of code. The problem is to find the product of the (only) pythagorean triplet for which the sum of the three numbers is 1000. Look at the problem description to learn what a pythagorean triplet is.
The code to solve this is again a simple iteration (within an iteration). The solution is written in thirteen lines of code - five of which are closing braces.
For every a and b combination c is calculated. If c is an integer, it is checked wether a+b+c equals 1000. If it does, the routine returns the product.
run with nodejs.
