module Exercise_6 where import Data.Ratio import Data.List {-WETT-} traceFractran :: [Rational] -> Integer -> [Integer] traceFractran rs n | length y == 0 = [n] | otherwise = n : traceFractran rs ( truncate $ fromIntegral n * head y ) where y = [d | d <- rs , n `mod` denominator d == 0 ] {-TTEW-}