Cody

Problem 1655. sum of first 'n' terms

Solution 2074590

Submitted on 30 Dec 2019 by Vineet Nippani
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

Test Suite

Test Status Code Input and Output
1   Pass
n = 10; y = 55; assert(isequal(summation(n),y))

y = 0 y = 1 y = 3 y = 6 y = 10 y = 15 y = 21 y = 28 y = 36 y = 45 y = 55

2   Pass
n = 0; y = 0; assert(isequal(summation(n),y))

y = 0

3   Pass
n = 17; y = 153; assert(isequal(summation(n),y))

y = 0 y = 1 y = 3 y = 6 y = 10 y = 15 y = 21 y = 28 y = 36 y = 45 y = 55 y = 66 y = 78 y = 91 y = 105 y = 120 y = 136 y = 153