Cody

Solution 1627116

Submitted on 13 Sep 2018 by Michael Cappello
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 = 15; sm_correct = 60; assert(isequal(sum3and5muls(n),sm_correct))

3 6 9 12 15 5 10 15 60

2   Pass
n = 18; sm_correct = 78; assert(isequal(sum3and5muls(n),sm_correct))

3 6 9 12 15 18 5 10 15 78

3   Pass
n = (2^2)-1; sm_correct = 3; assert(isequal(sum3and5muls(n),sm_correct))

3 3

4   Pass
n = randi(25); sm_correct = sum(3:3:n)+sum(5:5:n)-sum(15:15:n); assert(isequal(sum3and5muls(n),sm_correct))

3 6 9 5 10 33