All pastes #1388441 Raw Edit

Project Euler #6

public python v1 · immutable
#1388441 ·published 2009-04-10 23:16 UTC
rendered paste body
def SumOfSquares(nmin,nmax):    total = 0.0    for i in range(nmin, nmax+1):        total += i**2    return totaldef SquareOfSums(nmin,nmax):    total = 0.0    total = ((nmax+nmin)*(nmax-nmin+1.0)/2)    total *= total    return totalprint('Difference between the sum of squares and square of sums: ',      SquareOfSums(1,100) - SumOfSquares(1,100))