Cody

Solution 2192265

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]))

Array indices must be positive integers or logical values. Error in Hofstadter (line 11) b(i)=b(b(i-1)) + b(i-b(i-1)-1) Error in Test1 (line 1) assert(isequal(Hofstadter(50),[29,26]))

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

Array indices must be positive integers or logical values. Error in Hofstadter (line 11) b(i)=b(b(i-1)) + b(i-b(i-1)-1) Error in Test2 (line 1) assert(isequal(Hofstadter(5),[3,2]))

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

Array indices must be positive integers or logical values. Error in Hofstadter (line 11) b(i)=b(b(i-1)) + b(i-b(i-1)-1) Error in Test3 (line 1) assert(isequal(Hofstadter(500),[255,254]))

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

Array indices must be positive integers or logical values. Error in Hofstadter (line 11) b(i)=b(b(i-1)) + b(i-b(i-1)-1) Error in Test4 (line 1) assert(isequal(Hofstadter(73),[40,34]))

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

Array indices must be positive integers or logical values. Error in Hofstadter (line 11) b(i)=b(b(i-1)) + b(i-b(i-1)-1) Error in Test5 (line 1) assert(isequal(Hofstadter(1489),[819 695]))

Suggested Problems

More from this Author148