'''<p>The sum of the squares of the first ten natural numbers is,</p>
$$1^2 + 2^2 + ... + 10^2 = 385$$
<p>The square of the sum of the first ten natural numbers is,</p>
$$(1 + 2 + ... + 10)^2 = 55^2 = 3025$$
<p>Hence the difference between the sum of the squares of the first ten natural numbers and the square of the sum is $3025 - 385 = 2640$.</p>
<p>Find the difference between the sum of the squares of the first one hundred natural numbers and the square of the sum.</p>'''

#code
import time
start_time = time.time()

limit = 100
sq_sum, sum = 0,0
for i in range(limit+1):
    sq_sum += i**2
    sum += i
print(sum**2 - sq_sum)

print("\n--- %s seconds ---" % (time.time() - start_time))