This solution is outdated. To rescore this solution, sign in.
Of course, this solution use the formula from Carl Friedrich Gauss for the sum of the integers from 0 to n.
Test | Status | Code Input and Output |
---|---|---|
1 | Pass |
x = 7;
y_correct = 8256;
assert(isequal(sum_int(x),y_correct))
|
2 | Pass |
x = 10;
y_correct = 524800;
assert(isequal(sum_int(x),y_correct))
|
244 Solvers
469 Solvers
Replace multiples of 5 with NaN
282 Solvers
313 Solvers
Number of Even Elements in Fibonacci Sequence
416 Solvers