hailstone x | even x = div x 2 | odd x = 3*x + 1 hailLen x | x> 1 = print hail n x | x == 1 = 1 where hail n 1 = n hail n x = hail (n+1) (hailstone x) n = 0 --divisors :: Int -> [Int] divisors n = [ i | i <- [2..(n `div` 2)] , n `mod` i == 0] join c []= " " join c (x:xs) | c== "X" = x | otherwise = x ++ rest where rest = c ++ join c xs pythagorean x = [(a,b,c)|a<-[1..x], b<-[1..a], c<-[1..x], (a^2)+(b^2) == (c^2)]