Cody

Solution 1463792

Submitted on 15 Mar 2018 by Reece Blunt
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))

t = 1

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

t = 3 t = 4 t = 6

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

t = 5 t = 6 t = 8 t = 11 t = 15

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

t = 30 t = 31 t = 33 t = 36 t = 40 t = 45 t = 51 t = 58 t = 66 t = 75 t = 85 t = 96 t = 108 t = 121 t = 135 t = 150 t = 166 t = 183 t = 201 t = 220 t = 240 t = 261 t = 283 t = 306 t = 330 t = 355 t = 381 t = 408 t = 436 t = 465