Cody

# Problem 1035. Generate a vector like 1,2,2,3,3,3,4,4,4,4

Solution 1952472

Submitted on 29 Sep 2019 by Khanh Le Quang
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
x = 2; y_correct = [1 2 2]; assert(isequal(your_fcn_name(x),y_correct))

num1 = 1 sum2 = 0 sum1 = 0 sum1 = 1 sum1 = 3 vec = 1 sum2 = 1 sum2 = 0 num1 = 2 vec = 1 2 sum2 = 1 vec = 1 2 2 sum2 = 2 sum2 = 0 num1 = 3 ans = 1 2 2

2   Pass
x = 5; y_correct = [1 2 2 3 3 3 4 4 4 4 5 5 5 5 5]; assert(isequal(your_fcn_name(x),y_correct))

num1 = 1 sum2 = 0 sum1 = 0 sum1 = 1 sum1 = 3 sum1 = 6 sum1 = 10 sum1 = 15 vec = 1 sum2 = 1 sum2 = 0 num1 = 2 vec = 1 2 sum2 = 1 vec = 1 2 2 sum2 = 2 sum2 = 0 num1 = 3 vec = 1 2 2 3 sum2 = 1 vec = 1 2 2 3 3 sum2 = 2 vec = 1 2 2 3 3 3 sum2 = 3 sum2 = 0 num1 = 4 vec = 1 2 2 3 3 3 4 sum2 = 1 vec = 1 2 2 3 3 3 4 4 sum2 = 2 vec = 1 2 2 3 3 3 4 4 4 sum2 = 3 vec = 1 2 2 3 3 3 4 4 4 4 sum2 = 4 sum2 = 0 num1 = 5 vec = 1 2 2 3 3 3 4 4 4 4 5 sum2 = 1 vec = 1 2 2 3 3 3 4 4 4 4 5 5 sum2 = 2 vec = 1 2 2 3 3 3 4 4 4 4 5 5 5 sum2 = 3 vec = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 sum2 = 4 vec = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 sum2 = 5 sum2 = 0 num1 = 6 ans = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5

3   Pass
x = 10; y_correct = [1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 ... 6 6 6 6 6 6 7 7 7 7 7 7 7 8 8 8 8 8 8 8 8 ... 9 9 9 9 9 9 9 9 9 10 10 10 10 10 10 10 10 10 10]; assert(isequal(your_fcn_name(x),y_correct))

num1 = 1 sum2 = 0 sum1 = 0 sum1 = 1 sum1 = 3 sum1 = 6 sum1 = 10 sum1 = 15 sum1 = 21 sum1 = 28 sum1 = 36 sum1 = 45 sum1 = 55 vec = 1 sum2 = 1 sum2 = 0 num1 = 2 vec = 1 2 sum2 = 1 vec = 1 2 2 sum2 = 2 sum2 = 0 num1 = 3 vec = 1 2 2 3 sum2 = 1 vec = 1 2 2 3 3 sum2 = 2 vec = 1 2 2 3 3 3 sum2 = 3 sum2 = 0 num1 = 4 vec = 1 2 2 3 3 3 4 sum2 = 1 vec = 1 2 2 3 3 3 4 4 sum2 = 2 vec = 1 2 2 3 3 3 4 4 4 sum2 = 3 vec = 1 2 2 3 3 3 4 4 4 4 sum2 = 4 sum2 = 0 num1 = 5 vec = 1 2 2 3 3 3 4 4 4 4 5 sum2 = 1 vec = 1 2 2 3 3 3 4 4 4 4 5 5 sum2 = 2 vec = 1 2 2 3 3 3 4 4 4 4 5 5 5 sum2 = 3 vec = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 sum2 = 4 vec = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 sum2 = 5 sum2 = 0 num1 = 6 vec = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 sum2 = 1 vec = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 sum2 = 2 vec = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 sum2 = 3 vec = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 sum2 = 4 vec = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 sum2 = 5 vec = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 sum2 = 6 sum2 = 0 num1 = 7 vec = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 sum2 = 1 vec = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 sum2 = 2 vec = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 sum2 = 3 vec = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 sum2 = 4 vec = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 7 sum2 = 5 vec = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 7 7 sum2 = 6 vec = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 7 7 7 sum2 = 7 sum2 = 0 num1 = 8 vec = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 7 7 7 8 sum2 = 1 vec = Columns 1 through 29 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 7 7 7 8 Column 30 8 sum2 = 2 vec = Columns 1 through 29 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 7 7 7 8 Columns 30 through 31 8 8 sum2 = 3 vec = Columns 1 through 29 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 7 7 7 8 Columns 30 through 32 8 8 8 sum2 = 4 vec = Columns 1 through 29 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 7 7 7 8 Columns 30 through 33 8 8 8 8 sum2 = 5 vec = Columns 1 through 29 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 7 7 7 8 Columns 30 through 34 8 8 8 8 8 sum2 = 6 vec = Columns 1 through 29 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 7 7 7 8 Columns 30 through 35 8 8 8 8 8 8 sum2 = 7 vec = Columns 1 through 29 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 7 7 7 8 Columns 30 through 36 8 8 8 8 8 8 8 sum2 = 8 sum2 = 0 num1 = 9 vec = Columns 1 through 29 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 7 7 7 8 Columns 30 through 37 8 8 8 8 8 8 8 9 sum2 = 1 vec = Columns 1 through 29 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 7 7 7 8 Columns 30 through 38 8 8 8 8 8 8 8 9 9 sum2 = 2 vec = Columns 1 through 29 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 7 7 7 8 Columns 30 through 39 8 8 8 8 8 8 8 9 9 9 sum2 = 3 vec = Columns 1 through 29 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 7 7 7 8 Columns 30 through 40 8 8 8 8 8 8 8 9 9 9 9 sum2 = 4 vec = Columns 1 through 29 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 7 7 7 8 Columns 30 through 41 8 8 8 8 8 8 8 9 9 9 9 9 sum2 = 5 vec = Columns 1 through 29 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 7 7 7 8 Columns 30 through 42 8 8 8 8 8 8 8 9 9 9 9 9 9 sum2 = 6 vec = Columns 1 through 29 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 7 7 7 8 Columns 30 through 43 8 8 8 8 8 8 8 9 9 9 9 9 9 9 sum2 = 7 vec = Columns 1 through 29 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 7 7 7 8 Columns 30 through 44 8 8 8 8 8 8 8 9 9 9 9 9 9 9 9 sum2 = 8 vec = Columns 1 through 29 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 7 7 7 8 Columns 30 through 45 8 8 8 8 8 8 8 9 9 9 9 9 9 9 9 9 sum2 = 9 sum2 = 0 num1 = 10 vec = Columns 1 through 29 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 7 7 7 8 Columns 30 through 46 8 8 8 8 8 8 8 9 9 9 9 9 9 9 9 9 10 sum2 = 1 vec = Columns 1 through 29 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 7 7 7 8 Columns 30 through 47 8 8 8 8 8 8 8 9 9 9 9 9 9 9 9 9 10 10 sum2 = 2 vec = Columns 1 through 29 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 7 7 7 8 Columns 30 through 48 8 8 8 8 8 8 8 9 9 9 9 9 9 9 9 9 10 10 10 sum2 = 3 vec = Columns 1 through 29 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 ...

4   Pass
x = 12; y_correct = [1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 ... 6 6 6 6 6 6 7 7 7 7 7 7 7 8 8 8 8 8 8 8 8 ... 9 9 9 9 9 9 9 9 9 10 10 10 10 10 10 10 10 10 10 ... 11 11 11 11 11 11 11 11 11 11 11 ... 12 12 12 12 12 12 12 12 12 12 12 12]; assert(isequal(your_fcn_name(x),y_correct))

num1 = 1 sum2 = 0 sum1 = 0 sum1 = 1 sum1 = 3 sum1 = 6 sum1 = 10 sum1 = 15 sum1 = 21 sum1 = 28 sum1 = 36 sum1 = 45 sum1 = 55 sum1 = 66 sum1 = 78 vec = 1 sum2 = 1 sum2 = 0 num1 = 2 vec = 1 2 sum2 = 1 vec = 1 2 2 sum2 = 2 sum2 = 0 num1 = 3 vec = 1 2 2 3 sum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3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 7 7 sum2 = 6 vec = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 7 7 7 sum2 = 7 sum2 = 0 num1 = 8 vec = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 7 7 7 8 sum2 = 1 vec = Columns 1 through 29 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 7 7 7 8 Column 30 8 sum2 = 2 vec = Columns 1 through 29 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 7 7 7 8 Columns 30 through 31 8 8 sum2 = 3 vec = Columns 1 through 29 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 7 7 7 8 Columns 30 through 32 8 8 8 sum2 = 4 vec = Columns 1 through 29 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 7 7 7 8 Columns 30 through 33 8 8 8 8 sum2 = 5 vec = Columns 1 through 29 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 7 7 7 8 Columns 30 through 34 8 8 8 8 8 sum2 = 6 vec = Columns 1 through 29 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 7 7 7 8 Columns 30 through 35 8 8 8 8 8 8 sum2 = 7 vec = Columns 1 through 29 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 7 7 7 8 Columns 30 through 36 8 8 8 8 8 8 8 sum2 = 8 sum2 = 0 num1 = 9 vec = Columns 1 through 29 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 7 7 7 8 Columns 30 through 37 8 8 8 8 8 8 8 9 sum2 = 1 vec = Columns 1 through 29 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 7 7 7 8 Columns 30 through 38 8 8 8 8 8 8 8 9 9 sum2 = 2 vec = Columns 1 through 29 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 7 7 7 8 Columns 30 through 39 8 8 8 8 8 8 8 9 9 9 sum2 = 3 vec = Columns 1 through 29 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 7 7 7 8 Columns 30 through 40 8 8 8 8 8 8 8 9 9 9 9 sum2 = 4 vec = Columns 1 through 29 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 7 7 7 8 Columns 30 through 41 8 8 8 8 8 8 8 9 9 9 9 9 sum2 = 5 vec = Columns 1 through 29 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 7 7 7 8 Columns 30 through 42 8 8 8 8 8 8 8 9 9 9 9 9 9 sum2 = 6 vec = Columns 1 through 29 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 7 7 7 8 Columns 30 through 43 8 8 8 8 8 8 8 9 9 9 9 9 9 9 sum2 = 7 vec = Columns 1 through 29 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 7 7 7 8 Columns 30 through 44 8 8 8 8 8 8 8 9 9 9 9 9 9 9 9 sum2 = 8 vec = Columns 1 through 29 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 7 7 7 8 Columns 30 through 45 8 8 8 8 8 8 8 9 9 9 9 9 9 9 9 9 sum2 = 9 sum2 = 0 num1 = 10 vec = Columns 1 through 29 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 7 7 7 8 Columns 30 through 46 8 8 8 8 8 8 8 9 9 9 9 9 9 9 9 9 10 sum2 = 1 vec = Columns 1 through 29 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 7 7 7 8 Columns 30 through 47 8 8 8 8 8 8 8 9 9 9 9 9 9 9 9 9 10 10 sum2 = 2 vec = Columns 1 through 29 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 7 7 7 8 Columns 30 through 48 8 8 8 8 8 8 8 9 9 9 9 9 9 9 9 9 10 10 10 sum2 = 3 vec = Columns 1 through 29 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 ...

5   Pass
x = 9; y_correct = [1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 ... 6 6 6 6 6 6 7 7 7 7 7 7 7 8 8 8 8 8 8 8 8 ... 9 9 9 9 9 9 9 9 9]; assert(isequal(your_fcn_name(x),y_correct))

num1 = 1 sum2 = 0 sum1 = 0 sum1 = 1 sum1 = 3 sum1 = 6 sum1 = 10 sum1 = 15 sum1 = 21 sum1 = 28 sum1 = 36 sum1 = 45 vec = 1 sum2 = 1 sum2 = 0 num1 = 2 vec = 1 2 sum2 = 1 vec = 1 2 2 sum2 = 2 sum2 = 0 num1 = 3 vec = 1 2 2 3 sum2 = 1 vec = 1 2 2 3 3 sum2 = 2 vec = 1 2 2 3 3 3 sum2 = 3 sum2 = 0 num1 = 4 vec = 1 2 2 3 3 3 4 sum2 = 1 vec = 1 2 2 3 3 3 4 4 sum2 = 2 vec = 1 2 2 3 3 3 4 4 4 sum2 = 3 vec = 1 2 2 3 3 3 4 4 4 4 sum2 = 4 sum2 = 0 num1 = 5 vec = 1 2 2 3 3 3 4 4 4 4 5 sum2 = 1 vec = 1 2 2 3 3 3 4 4 4 4 5 5 sum2 = 2 vec = 1 2 2 3 3 3 4 4 4 4 5 5 5 sum2 = 3 vec = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 sum2 = 4 vec = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 sum2 = 5 sum2 = 0 num1 = 6 vec = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 sum2 = 1 vec = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 sum2 = 2 vec = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 sum2 = 3 vec = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 sum2 = 4 vec = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 sum2 = 5 vec = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 sum2 = 6 sum2 = 0 num1 = 7 vec = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 sum2 = 1 vec = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 sum2 = 2 vec = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 sum2 = 3 vec = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 sum2 = 4 vec = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 7 sum2 = 5 vec = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 7 7 sum2 = 6 vec = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 7 7 7 sum2 = 7 sum2 = 0 num1 = 8 vec = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 7 7 7 8 sum2 = 1 vec = Columns 1 through 29 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 7 7 7 8 Column 30 8 sum2 = 2 vec = Columns 1 through 29 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 7 7 7 8 Columns 30 through 31 8 8 sum2 = 3 vec = Columns 1 through 29 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 7 7 7 8 Columns 30 through 32 8 8 8 sum2 = 4 vec = Columns 1 through 29 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 7 7 7 8 Columns 30 through 33 8 8 8 8 sum2 = 5 vec = Columns 1 through 29 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 7 7 7 8 Columns 30 through 34 8 8 8 8 8 sum2 = 6 vec = Columns 1 through 29 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 7 7 7 8 Columns 30 through 35 8 8 8 8 8 8 sum2 = 7 vec = Columns 1 through 29 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 7 7 7 8 Columns 30 through 36 8 8 8 8 8 8 8 sum2 = 8 sum2 = 0 num1 = 9 vec = Columns 1 through 29 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 7 7 7 8 Columns 30 through 37 8 8 8 8 8 8 8 9 sum2 = 1 vec = Columns 1 through 29 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 7 7 7 8 Columns 30 through 38 8 8 8 8 8 8 8 9 9 sum2 = 2 vec = Columns 1 through 29 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 7 7 7 8 Columns 30 through 39 8 8 8 8 8 8 8 9 9 9 sum2 = 3 vec = Columns 1 through 29 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 7 7 7 8 Columns 30 through 40 8 8 8 8 8 8 8 9 9 9 9 sum2 = 4 vec = Columns 1 through 29 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 7 7 7 8 Columns 30 through 41 8 8 8 8 8 8 8 9 9 9 9 9 sum2 = 5 vec = Columns 1 through 29 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 7 7 7 8 Columns 30 through 42 8 8 8 8 8 8 8 9 9 9 9 9 9 sum2 = 6 vec = Columns 1 through 29 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 7 7 7 8 Columns 30 through 43 8 8 8 8 8 8 8 9 9 9 9 9 9 9 sum2 = 7 vec = Columns 1 through 29 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 7 7 7 8 Columns 30 through 44 8 8 8 8 8 8 8 9 9 9 9 9 9 9 9 sum2 = 8 vec = Columns 1 through 29 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 7 7 7 8 Columns 30 through 45 8 8 8 8 8 8 8 9 9 9 9 9 9 9 9 9 sum2 = 9 sum2 = 0 num1 = 10 ans = Columns 1 through 29 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 7 7 7 8 Columns 30 through 45 8 8 8 8 8 8 8 9 9 9 9 9 9 9 9 9

6   Pass
x = 7; y_correct = [1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 ... 6 6 6 6 6 6 7 7 7 7 7 7 7]; assert(isequal(your_fcn_name(x),y_correct))

num1 = 1 sum2 = 0 sum1 = 0 sum1 = 1 sum1 = 3 sum1 = 6 sum1 = 10 sum1 = 15 sum1 = 21 sum1 = 28 vec = 1 sum2 = 1 sum2 = 0 num1 = 2 vec = 1 2 sum2 = 1 vec = 1 2 2 sum2 = 2 sum2 = 0 num1 = 3 vec = 1 2 2 3 sum2 = 1 vec = 1 2 2 3 3 sum2 = 2 vec = 1 2 2 3 3 3 sum2 = 3 sum2 = 0 num1 = 4 vec = 1 2 2 3 3 3 4 sum2 = 1 vec = 1 2 2 3 3 3 4 4 sum2 = 2 vec = 1 2 2 3 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= 8 ans = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 7 7 7

7   Pass
x = 15; y_correct = [1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 ... 6 6 6 6 6 6 7 7 7 7 7 7 7 8 8 8 8 8 8 8 8 ... 9 9 9 9 9 9 9 9 9 10 10 10 10 10 10 10 10 10 10 ... 11 11 11 11 11 11 11 11 11 11 11 ... 12 12 12 12 12 12 12 12 12 12 12 12 ... 13 13 13 13 13 13 13 13 13 13 13 13 13 ... 14 14 14 14 14 14 14 14 14 14 14 14 14 14 ... 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15]; assert(isequal(your_fcn_name(x),y_correct))

num1 = 1 sum2 = 0 sum1 = 0 sum1 = 1 sum1 = 3 sum1 = 6 sum1 = 10 sum1 = 15 sum1 = 21 sum1 = 28 sum1 = 36 sum1 = 45 sum1 = 55 sum1 = 66 sum1 = 78 sum1 = 91 sum1 = 105 sum1 = 120 vec = 1 sum2 = 1 sum2 = 0 num1 = 2 vec = 1 2 sum2 = 1 vec = 1 2 2 sum2 = 2 sum2 = 0 num1 = 3 vec = 1 2 2 3 sum2 = 1 vec = 1 2 2 3 3 sum2 = 2 vec = 1 2 2 3 3 3 sum2 = 3 sum2 = 0 num1 = 4 vec = 1 2 2 3 3 3 4 sum2 = 1 vec = 1 2 2 3 3 3 4 4 sum2 = 2 vec = 1 2 2 3 3 3 4 4 4 sum2 = 3 vec = 1 2 2 3 3 3 4 4 4 4 sum2 = 4 sum2 = 0 num1 = 5 vec = 1 2 2 3 3 3 4 4 4 4 5 sum2 = 1 vec = 1 2 2 3 3 3 4 4 4 4 5 5 sum2 = 2 vec = 1 2 2 3 3 3 4 4 4 4 5 5 5 sum2 = 3 vec = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 sum2 = 4 vec = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 sum2 = 5 sum2 = 0 num1 = 6 vec = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 sum2 = 1 vec = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 sum2 = 2 vec = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 sum2 = 3 vec = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 sum2 = 4 vec = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 sum2 = 5 vec = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 sum2 = 6 sum2 = 0 num1 = 7 vec = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 sum2 = 1 vec = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 sum2 = 2 vec = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 sum2 = 3 vec = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 sum2 = 4 vec = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 7 sum2 = 5 vec = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 7 7 sum2 = 6 vec = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 7 7 7 sum2 = 7 sum2 = 0 num1 = 8 vec = 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 7 7 7 8 sum2 = 1 vec = Columns 1 through 29 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 7 7 7 8 Column 30 8 sum2 = 2 vec = Columns 1 through 29 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 7 7 7 8 Columns 30 through 31 8 8 sum2 = 3 vec = Columns 1 through 29 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 7 7 7 8 Columns 30 through 32 8 8 8 sum2 = 4 vec = Columns 1 through 29 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 7 7 7 8 Columns 30 through 33 8 8 8 8 sum2 = 5 vec = Columns 1 through 29 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 7 7 7 8 Columns 30 through 34 8 8 8 8 8 sum2 = 6 vec = Columns 1 through 29 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 7 7 7 8 Columns 30 through 35 8 8 8 8 8 8 sum2 = 7 vec = Columns 1 through 29 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 7 7 7 8 Columns 30 through 36 8 8 8 8 8 8 8 sum2 = 8 sum2 = 0 num1 = 9 vec = Columns 1 through 29 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 7 7 7 8 Columns 30 through 37 8 8 8 8 8 8 8 9 sum2 = 1 vec = Columns 1 through 29 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 7 7 7 8 Columns 30 through 38 8 8 8 8 8 8 8 9 9 sum2 = 2 vec = Columns 1 through 29 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 7 7 7 8 Columns 30 through 39 8 8 8 8 8 8 8 9 9 9 sum2 = 3 vec = Columns 1 through 29 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 7 7 7 8 Columns 30 through 40 8 8 8 8 8 8 8 9 9 9 9 sum2 = 4 vec = Columns 1 through 29 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 7 7 7 8 Columns 30 through 41 8 8 8 8 8 8 8 9 9 9 9 9 sum2 = 5 vec = Columns 1 through 29 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 7 7 7 8 Columns 30 through 42 8 8 8 8 8 8 8 9 9 9 9 9 9 sum2 = 6 vec = Columns 1 through 29 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 7 7 7 8 Columns 30 through 43 8 8 8 8 8 8 8 9 9 9 9 9 9 9 sum2 = 7 vec = Columns 1 through 29 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 7 7 7 8 Columns 30 through 44 8 8 8 8 8 8 8 9 9 9 9 9 9 9 9 sum2 = 8 vec = Columns 1 through 29 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 7 7 7 8 Columns 30 through 45 8 8 8 8 8 8 8 9 9 9 9 9 9 9 9 9 sum2 = 9 sum2 = 0 num1 = 10 vec = Columns 1 through 29 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 7 7 7 8 Columns 30 through 46 8 8 8 8 8 8 8 9 9 9 9 9 9 9 9 9 10 sum2 = 1 vec = Columns 1 through 29 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 7 7 7 8 Columns 30 through 47 8 8 8 8 8 8 8 9 9 9 9 9 9 9 9 9 10 10 sum2 = 2 vec = Columns 1 through 29 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 7 7 7 8 Columns 30 through 48 8 8 8 8 8 8 8 9 9 9 9 9 9 9 9 9 10 10 10 sum2 = 3 vec = Columns 1 through 29 1 2 2 3 3 3 4 4...