What is 1 + 2 + ⋯ (till n)?
Saturday, June 04, 2022
The answer is:
n × (n + 1) / 2
Let's check with an example, n = 4.
1 + 2 + 3 + 4
= 4 × (4 + 1) / 2
= 4 × 5 / 2
= 10
= 4 × (4 + 1) / 2
= 4 × 5 / 2
= 10
Yep. That's right.
Let's see if we can prove this...
(Continue scrolling to play the animation. Please use a smooth scrolling device like a touchscreen or a trackpad.)
(@-me on twitter @kssreeram for comments and feedback.)