loading
open in
main.py
1
2
n = int(input('first n natural numbers, n ='))
print "Difference =", n*(n-1)*(n+1)*(3*n+2)//12
Python 2.7.10 (default, Jul 14 2015, 19:46:27) [GCC 4.8.2] on linux