module Exercise_6 where import Data.Ratio import Data.Maybe import Data.List import GHC.Num --import GHC.Integer --neqInteger {-WETT-} traceFractran :: [Rational] -> Integer -> [Integer] traceFractran rs n = neqInteger 0 `takeWhile` iterate trace n where trace n=round $ fromMaybe 0 $ isInt `find` map (*fromIntegral n) rs isInt x= 1==denominator x {-TTEW-} {- traceFractran2 rs n= if null list then [n] else n: rs `traceFractran2` head list where list = [round r|r<- map (* fromIntegral n) rs,denominator r== 1 ] -} primeprog = [17%91 ,78%85 ,19%51 ,23%38 ,29%33 ,77%29 ,95%23 ,77%19 ,1%17 ,11%13 ,13%11 ,15%14 ,15%2 ,55%1]