-- The proper divisors of a given integer.
divisors :: Integral a => a -> [a]
divisors x = (nub.init) $ firstHalf ++ secondHalf
        where
            firstHalf = 1: (filter ((==0) . rem x) [2 .. sq x])
            secondHalf = reverse [ x `div` i | i <- firstHalf]
            sq = floor . sqrt . fromIntegral

-- Whether a number is abundant.
divisors :: Integral a => a -> [a]
divisors x = (nub.init) $ firstHalf ++ secondHalf
        where
            firstHalf = 1: (filter ((==0) . rem x) [2 .. sq x])
            secondHalf = reverse [ x `div` i | i <- firstHalf]
            sq = floor . sqrt . fromIntegral

-- Whether a number is abundant.
divisors x = (nub.init) $ firstHalf ++ secondHalf
        where
            firstHalf = 1: (filter ((==0) . rem x) [2 .. sq x])
            secondHalf = reverse [ x `div` i | i <- firstHalf]
            sq = floor . sqrt . fromIntegral

-- Whether a number is abundant.