Problem 9
p9 :: [[Int]] -> [[Int]] p9 [] = [] p9 (x:xs) | ok x = x : p9 xs | otherwise = p9 xs where ok (a:b:c:_) | a*a + b*b == c*c && a+b+c == 1000 = True | otherwise = False (\x -> head x * (head $ tail x) * (head $ tail $ tail x )) $ head $ p9 [[a,b,c] | c <- [1..1000], b <- [1..c-1], a <- [1..b-1]]