Cody

Solution 2027098

Submitted on 19 Nov 2019 at 3:03
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 = 1881;y_correct = 30; assert(isequal(yearraey(x),y_correct))

k = 1 y = 30

2   Fail
x = 2014;y_correct = 1; assert(isequal(yearraey(x),y_correct))

k = 1 y = 0 y = 33

Assertion failed.

3   Fail
x = 2015;y_correct = 0; assert(isequal(yearraey(x),y_correct))

k = 1 y = 32

Assertion failed.

4   Pass
x = 606;y_correct = 27; assert(isequal(yearraey(x),y_correct))

k = 1 y = 27

5   Pass
x = 6006;y_correct = 71; assert(isequal(yearraey(x),y_correct))

k = 1 y = 71

6   Pass
x = 60006;y_correct = 369; assert(isequal(yearraey(x),y_correct))

k = 1 y = 369

7   Pass
k=zeros(1,15); for n=1:15 y=2^n+2; k(n)=yearraey(y); end y_correct=[1 1 5 3 11 7 23 15 47 31 95 63 191 127 383]; assert(isequal(k,y_correct))

k = 1 y = 1 k = 1 y = 1 k = 1 y = 5 k = 1 y = 3 k = 1 y = 11 k = 1 y = 7 k = 1 y = 23 k = 1 y = 15 k = 1 y = 47 k = 1 y = 31 k = 1 y = 95 k = 1 y = 63 k = 1 y = 191 k = 1 y = 127 k = 1 y = 383