]
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]

--
-- 約数の個数
--
numberOfDivisors :: Integral
polyNum :: Integral a => a -> a -> a
polyNum p n = div (n * ((p - 2) * n - (p - 4))) 2
polyNum p n = div (n * ((p - 2) * n - (p - 4))) 2