Cody

Problem 1119. sum of non-primes

Solution 2679638

Submitted on 11 Jul 2020
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   Fail
x = 3; y_correct = 1; assert(isequal(sum_non_primes(x),y_correct))

Assertion failed.

2   Pass
x=10; y_correct = 38; assert(isequal(sum_non_primes(x),y_correct))

b = 0 0 0 4 b = 0 0 0 4 0 6 b = 0 0 0 4 0 6 0 8 b = 0 0 0 4 0 6 0 8 9 b = 0 0 0 4 0 6 0 8 9 10

3   Pass
x=1000; y_correct = 424373; assert(isequal(sum_non_primes(x),y_correct))

b = 0 0 0 4 b = 0 0 0 4 0 6 b = 0 0 0 4 0 6 0 8 b = 0 0 0 4 0 6 0 8 9 b = 0 0 0 4 0 6 0 8 9 10 b = 0 0 0 4 0 6 0 8 9 10 0 12 b = 0 0 0 4 0 6 0 8 9 10 0 12 0 14 b = 0 0 0 4 0 6 0 8 9 10 0 12 0 14 15 b = 0 0 0 4 0 6 0 8 9 10 0 12 0 14 15 b = 0 0 0 4 0 6 0 8 9 10 0 12 0 14 15 16 b = 0 0 0 4 0 6 0 8 9 10 0 12 0 14 15 16 0 18 b = 0 0 0 4 0 6 0 8 9 10 0 12 0 14 15 16 0 18 0 20 b = 0 0 0 4 0 6 0 8 9 10 0 12 0 14 15 16 0 18 0 20 21 b = 0 0 0 4 0 6 0 8 9 10 0 12 0 14 15 16 0 18 0 20 21 b = 0 0 0 4 0 6 0 8 9 10 0 12 0 14 15 16 0 18 0 20 21 22 b = 0 0 0 4 0 6 0 8 9 10 0 12 0 14 15 16 0 18 0 20 21 22 0 24 b = 0 0 0 4 0 6 0 8 9 10 0 12 0 14 15 16 0 18 0 20 21 22 0 24 25 b = 0 0 0 4 0 6 0 8 9 10 0 12 0 14 15 16 0 18 0 20 21 22 0 24 25 26 b = 0 0 0 4 0 6 0 8 9 10 0 12 0 14 15 16 0 18 0 20 21 22 0 24 25 26 27 b = 0 0 0 4 0 6 0 8 9 10 0 12 0 14 15 16 0 18 0 20 21 22 0 24 25 26 27 b = 0 0 0 4 0 6 0 8 9 10 0 12 0 14 15 16 0 18 0 20 21 22 0 24 25 26 27 28 b = 0 0 0 4 0 6 0 8 9 10 0 12 0 14 15 16 0 18 0 20 21 22 0 24 25 26 27 28 0 30 b = Columns 1 through 30 0 0 0 4 0 6 0 8 9 10 0 12 0 14 15 16 0 18 0 20 21 22 0 24 25 26 27 28 0 30 Columns 31 through 32 0 32 b = Columns 1 through 30 0 0 0 4 0 6 0 8 9 10 0 12 0 14 15 16 0 18 0 20 21 22 0 24 25 26 27 28 0 30 Columns 31 through 33 0 32 33 b = Columns 1 through 30 0 0 0 4 0 6 0 8 9 10 0 12 0 14 15 16 0 18 0 20 21 22 0 24 25 26 27 28 0 30 Columns 31 through 33 0 32 33 b = Columns 1 through 30 0 0 0 4 0 6 0 8 9 10 0 12 0 14 15 16 0 18 0 20 21 22 0 24 25 26 27 28 0 30 Columns 31 through 34 0 32 33 34 b = Columns 1 through 30 0 0 0 4 0 6 0 8 9 10 0 12 0 14 15 16 0 18 0 20 21 22 0 24 25 26 27 28 0 30 Columns 31 through 35 0 32 33 34 35 b = Columns 1 through 30 0 0 0 4 0 6 0 8 9 10 0 12 0 14 15 16 0 18 0 20 21 22 0 24 25 26 27 28 0 30 Columns 31 through 35 0 32 33 34 35 b = Columns 1 through 30 0 0 0 4 0 6 0 8 9 10 0 12 0 14 15 16 0 18 0 20 21 22 0 24 25 26 27 28 0 30 Columns 31 through 36 0 32 33 34 35 36 b = Columns 1 through 30 0 0 0 4 0 6 0 8 9 10 0 12 0 14 15 16 0 18 0 20 21 22 0 24 25 26 27 28 0 30 Columns 31 through 38 0 32 33 34 35 36 0 38 b = Columns 1 through 30 0 0 0 4 0 6 0 8 9 10 0 12 0 14 15 16 0 18 0 20 21 22 0 24 25 26 27 28 0 30 Columns 31 through 39 0 32 33 34 35 36 0 38 39 b = Columns 1 through 30 0 0 0 4 0 6 0 8 9 10 0 12 0 14 15 16 0 18 0 20 21 22 0 24 25 26 27 28 0 30 Columns 31 through 39 0 32 33 34 35 36 0 38 39 b = Columns 1 through 30 0 0 0 4 0 6 0 8 9 10 0 12 0 14 15 16 0 18 0 20 21 22 0 24 25 26 27 28 0 30 Columns 31 through 40 0 32 33 34 35 36 0 38 39 40 b = Columns 1 through 30 0 0 0 4 0 6 0 8 9 10 0 12 0 14 15 16 0 18 0 20 21 22 0 24 25 26 27 28 0 30 Columns 31 through 42 0 32 33 34 35 36 0 38 39 40 0 42 b = Columns 1 through 30 0 0 0 4 0 6 0 8 9 10 0 12 0 14 15 16 0 18 0 20 21 22 0 24 25 26 27 28 0 30 Columns 31 through 44 0 32 33 34 35 36 0 38 39 40 0 42 0 44 b = Columns 1 through 30 0 0 0 4 0 6 0 8 9 10 0 12 0 14 15 16 0 18 0 20 21 22 0 24 25 26 27 28 0 30 Columns 31 through 45 0 32 33 34 35 36 0 38 39 40 0 42 0 44 45 b = Columns 1 through 30 0 0 0 4 0 6 0 8 9 10 0 12 0 14 15 16 0 18 0 20 21 22 0 24 25 26 27 28 0 30 Columns 31 through 45 0 32 33 34 35 36 0 38 39 40 0 42 0 44 45 b = Columns 1 through 30 0 0 0 4 0 6 0 8 9 10 0 12 0 14 15 16 0 18 0 20 21 22 0 24 25 26 27 28 0 30 Columns 31 through 45 0 32 33 34 35 36 0 38 39 40 0 42 0 44 45 b = Columns 1 through 30 0 0 0 4 0 6 0 8 9 10 0 12 0 14 15 16 0 18 0 20 21 22 0 24 25 26 27 28 0 30 Columns 31 through 45 0 32 33 34 35 36 0 38 39 40 0 42 0 44 45 b = Columns 1 through 30 0 0 0 4 0 6 0 8 9 10 0 12 0 14 15 16 0 18 0 20 21 22 0 24 25 26 27 28 0 30 Columns 31 through 46 0 32 33 34 35 36 0 38 39 40 0 42 0 44 45 46 b = Columns 1 through 30 0 0 0 4 0 6 0 8 9 10 0 12 0 14 15 16 0 18 0 20 21 22 0 24 25 26 27 28 0 30 Columns 31 through 48 0 32 33 34 35 36 0 38 39 40 0 42 0 44 45 46 0 48 b = Columns 1 through 30 0 0 0 4 0 6 0 8 9 10 0 12 0 14 15 16 0 18 0 20 21 22 0 24 25 26 27 28 0 30 Columns 31 through 49 0 32 33 34 35 36 0 38 39 40 0 42 0 44 45 46 0 48 49 b = Columns 1 through 30 0 0 0 4 0 6 0 8 9 10 0 12 0 14 15 16 0 18 0 20 21 22 0 24 25 26 27 28 0 30 Columns 31 through 50 0 32 33 34 35 36 0 38 39 40 0 42 0 44 45 46 0 48 49 50 b = Columns 1 through 30 0 0 0 4 0 6 0 8 9 10 0 12 0 14 15 16 0 18 0 20 21 22 0 24 25 26 27 28 0 30 Columns 31 through 51 0 32 33 34 35 36 0 38 39 40 0 42 0 44 45 46 0 48 49 50 51 b = Columns 1 through 30 0 0 0 4 0 6 0 8 9 10 0 12 0 14 15 16 0 18 0 20 21 22 0 24 25 26 27 28 0 30 Columns 31 through 51 0 32 33 34 35 36 0 38 39 40 0 42 0 44 45 46 0 48 49 50 51 b = Columns 1 through 30 0 0 0 4 0 6 0 8 9 10 0 12 0 14 15 16 0 18 0 20 21 22 0 24 25 26 27 28 0 30 Columns 31 through 52 0 32 33 34 35 36 0 38 39 40 0 42 0 44 45 46 0 48 4...