@betaProjects/

Project Euler 6

Python 2.7

No description

fork
loading
Files
  • main.py
main.py
1
2
3
# -*- coding: iso-8859-15 -*-
n = int(input('first n natural numbers, n ='))
print "Difference: (Σn)² - Σn² =", n*(n-1)*(n+1)*(3*n+2)//12