Cody

# Problem 1190. Golomb's self-describing sequence (based on Euler 341)

Solution 1695743

Submitted on 19 Dec 2018
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
assert(isequal(euler341(1),1))

ans = 1

2   Fail
assert(isequal(euler341(10),5))

vec = 2 4 3 6 ind = 4 vec = 2 6 3 9 ind = 3 ans = 29

Assertion failed.

3   Fail
assert(isequal(euler341(310),42))

vec = 2 4 3 6 ind = 4 vec = 2 6 3 9 ind = 6

Index exceeds the number of array elements (4). Error in euler341 (line 7) G(act+1:act+ind)=vec(1:ind); Error in Test3 (line 1) assert(isequal(euler341(310),42))

4   Fail
assert(isequal(euler341(4242),210))

vec = 2 4 3 6 ind = 4 vec = 2 6 3 9 ind = 6

Index exceeds the number of array elements (4). Error in euler341 (line 7) G(act+1:act+ind)=vec(1:ind); Error in Test4 (line 1) assert(isequal(euler341(4242),210))

5   Fail
assert(isequal(euler341(328509),3084))

vec = 2 4 3 6 ind = 4 vec = 2 6 3 9 ind = 6

Index exceeds the number of array elements (4). Error in euler341 (line 7) G(act+1:act+ind)=vec(1:ind); Error in Test5 (line 1) assert(isequal(euler341(328509),3084))

6   Fail
assert(isequal(euler341(551368),4247))

vec = 2 4 3 6 ind = 4 vec = 2 6 3 9 ind = 6

Index exceeds the number of array elements (4). Error in euler341 (line 7) G(act+1:act+ind)=vec(1:ind); Error in Test6 (line 1) assert(isequal(euler341(551368),4247))

7   Fail
assert(isequal(euler341(614125),4540))

vec = 2 4 3 6 ind = 4 vec = 2 6 3 9 ind = 6

Index exceeds the number of array elements (4). Error in euler341 (line 7) G(act+1:act+ind)=vec(1:ind); Error in Test7 (line 1) assert(isequal(euler341(614125),4540))