Cody

Problem 45383. $10,000 sequence

Solution 2192268

Submitted on 4 Apr 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
assert(isequal(Hofstadter(50),[29,26]))

ans = 29 ans = 0

Assertion failed.

2   Fail
assert(isequal(Hofstadter(5),[3,2]))

ans = 3 ans = 0

Assertion failed.

3   Fail
assert(isequal(Hofstadter(500),[255,254]))

ans = 255 ans = 0

Assertion failed.

4   Fail
assert(isequal(Hofstadter(73),[40,34]))

ans = 40 ans = 0

Assertion failed.

5   Fail
assert(isequal(Hofstadter(1489),[819 695]))

ans = 819 ans = 0

Assertion failed.

Suggested Problems

More from this Author149

Community Treasure Hunt

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

Start Hunting!