-
Notifications
You must be signed in to change notification settings - Fork 2
sumkindofproblem
bradendubois edited this page Nov 24, 2021
·
9 revisions
ID: sumkindofproblem
Difficulty: 1.5
CPU Time: 1 second
Memory: 1024 MB
Three formulas can be used for the sum of the first N, positive, odd, and even integers.
- Positive = (N * (N + 1)) / 2
- Odd = N * N
- Even = N * (N + 1)
- Can even just do odd first and add N to it to get even.