We're a place where coders share, stay up-to-date and grow their careers.
import GHC.Real (Ratio(..)) isProper n x = let (a :% b) = (x / n) :: Rational in if b == n then True else False properFractions n = length [a / n | a <- [1..n], isProper n a]
Discussion on: Daily Challenge #78 - Number of Proper Fractions with Denominator d