module Exercise_6 where import Data.Ratio import Data.List import Data.Maybe {-WETT-} traceFractran :: [Rational] -> Integer -> [Integer] traceFractran rs n = n:if null s then [] else traceFractran rs (numerator $ fromInteger n * fromJust s) where s = find p2 rs p2 a = denominator (a * fromInteger n) == 1 {-TTEW-}