ower (\x y -> mod (x * y) m) 1 a n



-----------------------------------------
-- 数列関連
-----------------------------------------

powerMod :: (Integral a, Integral t) => t -> a -> t -> t
powerMod a n m = power (\x y -> mod (x * y) m) 1 a n
powerMod a n m = power (\x y -> mod (x * y) m) 1 a n