Skip to content

Instantly share code, notes, and snippets.

@franklin-e
Created August 29, 2010 23:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save franklin-e/556812 to your computer and use it in GitHub Desktop.
Save franklin-e/556812 to your computer and use it in GitHub Desktop.
side = 1111
corners = [1]
stepper = (1, 2, 2, 2)
counter = 1
side -= 1
while counter <= side * side:
counter += 1
for step in stepper:
counter += step
corners.append(counter)
new_step = stepper[0] + 2
stepper = (new_step, new_step+1, new_step+1, new_step+1)
print sum(corners)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment