Skip to content

Instantly share code, notes, and snippets.

@hatashiro
Created April 13, 2012 15:20
Show Gist options
  • Save hatashiro/2377619 to your computer and use it in GitHub Desktop.
Save hatashiro/2377619 to your computer and use it in GitHub Desktop.
Projecteuler #6
def sum_of_square_from_1_to(int):
return sum([i**2 for i in range(1, int+1)])
def square_of_sum_from_1_to(int):
return sum(range(1, int+1))**2
def result(int):
return square_of_sum_from_1_to(int) - sum_of_square_from_1_to(int)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment