Skip to content

Instantly share code, notes, and snippets.

@loudoweb
Created March 18, 2021 08:35
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 loudoweb/2ac9dbcc2fedb2f2245532efea723e59 to your computer and use it in GitHub Desktop.
Save loudoweb/2ac9dbcc2fedb2f2245532efea723e59 to your computer and use it in GitHub Desktop.
Math
Consecutives numbers sum => (max - min + 1) * (max + min) / 2
e.g: 3 + 4 + 5 + 6 = (6 - 3 + 1) * (3 + 6) / 2 = 18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment