Cody

# Problem 44338. Recaman Sequence - I

Solution 2759461

Submitted on 30 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 = 1; y_correct = 0; assert(isequal(Recaman(x),y_correct))

Error in solution: Line: 5 Column: 53 Invalid expression. When calling a function or indexing a variable, use parentheses. Otherwise, check for mismatched delimiters.

2   Fail
x = 5; y_correct = [0 1 3 6 2]; assert(isequal(Recaman(x),y_correct))

Error in solution: Line: 5 Column: 53 Invalid expression. When calling a function or indexing a variable, use parentheses. Otherwise, check for mismatched delimiters.

3   Fail
x = 8; y_correct = [0 1 3 6 2 7 13 20]; assert(isequal(Recaman(x),y_correct))

Error in solution: Line: 5 Column: 53 Invalid expression. When calling a function or indexing a variable, use parentheses. Otherwise, check for mismatched delimiters.

4   Fail
x = 10; y_correct = [0 1 3 6 2 7 13 20 12 21]; assert(isequal(Recaman(x),y_correct))

Error in solution: Line: 5 Column: 53 Invalid expression. When calling a function or indexing a variable, use parentheses. Otherwise, check for mismatched delimiters.

5   Fail
x = 5e4; y = Recaman(x); assert(isequal(length(Recaman(x)),x)) assert(isequal(y(954),739)) assert(isequal(y(7589),17654)) assert(isequal(y(12345),18554))

Error in solution: Line: 5 Column: 53 Invalid expression. When calling a function or indexing a variable, use parentheses. Otherwise, check for mismatched delimiters.

6   Fail
x = 1e5; y = Recaman(x); assert(isequal(length(Recaman(x)),x)) assert(isequal(y(1e4),8658)) assert(isequal(y(2e4),34358)) assert(isequal(y(3e4),92474)) assert(isequal(y(4e4),102344))

Error in solution: Line: 5 Column: 53 Invalid expression. When calling a function or indexing a variable, use parentheses. Otherwise, check for mismatched delimiters.

### Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!