> a -> Int
numberOfDivisors n = product [i + 1 | (_, i) <- factorize n]

--
-- 約数の和
--
sumOfDivisors :: Integral a => a -> a
sumOfDivisors n = product [f p i | (p, i) <- factorize n]
    where f p i = div (p ^ (i + 1) - 1) (p - 1)

--
-- 完全数か ?
--
isPerfect :: Integral a => a -> Bool
isPerfect n = n + n == sumOfDivisors n
divisor :: Integral a => a -> [a]
divisor n = sort $ foldr f [1] ns
    where
      ns = [map (p ^) [0 .. i] | (p, i) <- factorize n]
      f ns1 ns2 = [x * y | x <- ns1, y <- ns2]

--
-- 約数の個数
--
divisor n = sort $ foldr f [1] ns
    where
      ns = [map (p ^) [0 .. i] | (p, i) <- factorize n]
      f ns1 ns2 = [x * y | x <- ns1, y <- ns2]

--
-- 約数の個数
--