module Exercise_6 where import Data.Ratio import Data.List {-WETT-} traceFractran :: [Rational] -> Integer -> [Integer] traceFractran fractions x = x : if null muls then [] else traceFractran fractions $ truncate $ head muls where muls = filter whole $ map (* (x % 1)) fractions whole x = ceiling x == floor x {-TTEW-}