Skip to content

Instantly share code, notes, and snippets.

@cFerg
Last active June 22, 2022 00:22
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 cFerg/ede71680827d98996bc5 to your computer and use it in GitHub Desktop.
Save cFerg/ede71680827d98996bc5 to your computer and use it in GitHub Desktop.

Proportion of Sums Formula - cFerg


A = Consecutive Numbers

B = Sum of Numbers

A B
1 1
2 3
3 6
4 10
5 15
6 21
7 28
8 36
9 45
  • 1 = 1
  • 1 + 2 = 3
  • 1 + 2 + 3 = 6
  • 1 + 2 + 3 + 4 = 10 ...

B = (A/2) * (A-1) + A


Example: A = 4

B = (4/2) * (4-1) + 4

B = (2) * (3) + 4

B = (6) + 4

B = 10

@cFerg
Copy link
Author

cFerg commented Jun 22, 2022

Variants of B:

B = (A * (A+1)) / 2
B = (A/2) * (A+1)
B = A * ((A+1) / 2)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment