Cody

Solution 1883088

Submitted on 24 Jul 2019 by Nikolaos Nikolaou
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))

t2 = 1 4 5 7 9 10 11 y = 30

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

t2 = 2 3 4 5 7 8 9 10 11 y = 1

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

t2 = 1 2 3 4 5 7 8 9 10 11 y = 0

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

t2 = 2 3 4 5 7 10 y = 27

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

t2 = 2 3 5 6 7 9 10 11 13 y = 71

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

t2 = 2 3 6 7 10 12 14 15 16 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))

t2 = 3 y = 1 t2 = 2 3 y = 1 t2 = 2 4 y = 5 t2 = 2 5 y = 3 t2 = 2 6 y = 11 t2 = 2 7 y = 7 t2 = 2 8 y = 23 t2 = 2 9 y = 15 t2 = 2 10 y = 47 t2 = 2 11 y = 31 t2 = 2 12 y = 95 t2 = 2 13 y = 63 t2 = 2 14 y = 191 t2 = 2 15 y = 127 t2 = 2 16 y = 383