Solution for problem 9; pythagorean triplets