Skip to content

Instantly share code, notes, and snippets.

@clementi
Created February 10, 2011 03:35
Show Gist options
  • Save clementi/819889 to your computer and use it in GitHub Desktop.
Save clementi/819889 to your computer and use it in GitHub Desktop.
Project Euler Problem #28 Solution
current = 0
step = 2
sum = 0
limit = 1001 ** 2
spiral = range(1, limit + 1)
while current < limit:
for i in range(4):
if current > limit:
break
sum += spiral[current]
current += step
step += 2
print sum
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment