# Efficient calculation of Faulhaber's formula (sum of powers)?

This is a discussion on Efficient calculation of Faulhaber's formula (sum of powers)? within the General Discussions forums, part of the Community Boards category; What I'm actually trying to do is efficiently calculate Faulhaber(N, E) modulo M (or at least Faulhaber(N, E) - the ...

1. ## Efficient calculation of Faulhaber's formula (sum of powers)?

What I'm actually trying to do is efficiently calculate Faulhaber(N, E) modulo M (or at least Faulhaber(N, E) - the modulo operation could be worked in later), where N, E, and M can be arbitrarily large. From what I have read, it seems that this is generally expressed in terms of either a polynomial to the degree of N+1 (memory-expensive) or some recursive relationship (time-expensive). Is there any way that this can be done that requires neither very much memory nor time?

2. Since the exponent changes, you'll be forced to use something like this:
Faulhaber's Formula -- from Wolfram MathWorld
(the first equation with the Kronecker delta etc, not the individual cases)

Power Sum -- from Wolfram MathWorld