Skip to content

Instantly share code, notes, and snippets.

@hexgnu
Created February 15, 2012 16:45
Show Gist options
  • Select an option

  • Save hexgnu/1837202 to your computer and use it in GitHub Desktop.

Select an option

Save hexgnu/1837202 to your computer and use it in GitHub Desktop.
1 + 2 + 3 + ... + 100 = N
+ 100 + 99 + 98 + ... + 1 = N
-----------------------------
101 + 101 + 101 + ... + 101 = 2 * N
(101 * 100) / 2 = N
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment