/ Published in: Python
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
#!/usr/bin/python # Project Euler - Problem 28 # Find the sum of the diagonals of a 1001x1001 spiral n = 1001 sum = 1 for x in range(1001,1,-2): sum += ((x**2) << 2) - (6*x) + 6 print sum