View Single Post
Old 03-20-2013, 06:27 PM   #25
Reincarnate
x'); DROP TABLE FFR;--
Retired StaffFFR Veteran
 
Reincarnate's Avatar
 
Join Date: Nov 2010
Posts: 6,332
Default Re: This time not stupid math

You can also use

http://en.wikipedia.org/wiki/Faulhaber%27s_formula

With the recursive definition for the Bernoulli numbers defined here

http://en.wikipedia.org/wiki/Bernoul...ive_definition


But I mean it may as well just be this...

Code:
def brute(x,y):
    return sum(i**(x-1) for i in range(1,y))

Last edited by Reincarnate; 03-20-2013 at 06:35 PM..
Reincarnate is offline   Reply With Quote