module Euler.Sum (
	sumN1, sumN2,
	sumStep
) where

sumN1 :: Integral a => a -> a
sumN1 n = n * (n + 1) `quot` 2

sumN2 :: Integral a => a -> a
sumN2 n = (2 * n + 1) * (n + 1) * n `quot` 6

sumStep :: Integral a => a -> a -> a
sumStep s n = s * sumN1 (n `quot` s)
