main :: IO () main = print . solve =<< readLn solve :: Int -> Float solve = fromRational . head . solve' where solve' :: Int -> [Rational] solve' 1 = [1] solve' n = 1 + (sum p / 6) : p where p = solve' (n - 1)