SumToN: Calculate sum of all numbers from 1 to n.