Accumulate a value by applying a function - in two different styles

Two different approaches to the problem of starting with a value, applying a function to it n times, and accumulating a result.