The sum of the numbers is O(1) - you can calculate it algorithmically.
N*(N+1)/2
Ref: http://www.wikihow.com/Sum-the-Integers-from-1-to-N
The sum of the numbers is O(1) - you can calculate it algorithmically.
N*(N+1)/2
Ref: http://www.wikihow.com/Sum-the-Integers-from-1-to-N