Cody

# Problem 5. Triangle Numbers

Solution 248071

Submitted on 23 May 2013 by Lucas Hughes
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 = 1; t = 1; assert(isequal(triangle(n),t))

old_i = 0 t = 1 old_i = 1

2   Pass
%% n = 3; t = 6; assert(isequal(triangle(n),t))

old_i = 0 t = 1 old_i = 1 t = 3 old_i = 3 t = 6 old_i = 6

3   Pass
%% n = 5; t = 15; assert(isequal(triangle(n),t))

old_i = 0 t = 1 old_i = 1 t = 3 old_i = 3 t = 6 old_i = 6 t = 10 old_i = 10 t = 15 old_i = 15

4   Pass
%% n = 30; t = 465; assert(isequal(triangle(n),t))

old_i = 0 t = 1 old_i = 1 t = 3 old_i = 3 t = 6 old_i = 6 t = 10 old_i = 10 t = 15 old_i = 15 t = 21 old_i = 21 t = 28 old_i = 28 t = 36 old_i = 36 t = 45 old_i = 45 t = 55 old_i = 55 t = 66 old_i = 66 t = 78 old_i = 78 t = 91 old_i = 91 t = 105 old_i = 105 t = 120 old_i = 120 t = 136 old_i = 136 t = 153 old_i = 153 t = 171 old_i = 171 t = 190 old_i = 190 t = 210 old_i = 210 t = 231 old_i = 231 t = 253 old_i = 253 t = 276 old_i = 276 t = 300 old_i = 300 t = 325 old_i = 325 t = 351 old_i = 351 t = 378 old_i = 378 t = 406 old_i = 406 t = 435 old_i = 435 t = 465 old_i = 465