Compute 1 + (1 + 2) + (1 + 2 + 3) + ... + (1 + 2 + 3 + ... + n) for n = 2020.
This series creates a series of triangular numbers:
1 = 1
1 + 2 = 3
1 + 2 + 3 = 6
1 + 2 + 3 + 4 = 10
...
1 + 2 + 3 + ... + 2020 = < which I don't need to calculate, because I won't need it >
The formula for the sum of n triangular numbers is: Sum = n · (n + 1) · (n + 2) / 6
Sum = 2020 · (2020 + 1) · (2020 + 2) / 6 = 1 375 775 540