Cody

# Problem 42835. Return the sequence element II

Solution 884222

Submitted on 30 Apr 2016
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 = 3; n = 5; y_correct = 6; assert(isequal(juggler(x,n),y_correct))

x = 5 x = 11 x = 36 x = 6

Error using VisibleTest1 (line 4) Output argument "y" (and maybe others) not assigned during call to "juggler".

2   Fail
x = 33; n = 3; y_correct = 2598; assert(isequal(juggler(x,n),y_correct))

x = 189 x = 2598

Error using VisibleTest2 (line 4) Output argument "y" (and maybe others) not assigned during call to "juggler".

3   Fail
x = 45; n = 4; y_correct = 72; assert(isequal(juggler(x,n),y_correct))

x = 301 x = 5222 x = 72

Error using VisibleTest3 (line 4) Output argument "y" (and maybe others) not assigned during call to "juggler".

4   Fail
x = 163; n = 23; y_correct = 333; assert(isequal(juggler(x,n),y_correct))

x = 2081 x = 94931 x = 29249071 x = 1.5819e+11 x = 6.2915e+16 x = 250828041 x = 3.9725e+12 x = 7.9176e+18 x = 2.8138e+09 x = 53045 x = 12217059 x = 4.2702e+10 x = 8.8242e+15 x = 8.2892e+23 x = 9.1045e+11 x = 8.6873e+17 x = 932056400 x = 30529 x = 5334194 x = 2309 x = 110952 x = 333

Error using VisibleTest4 (line 4) Output argument "y" (and maybe others) not assigned during call to "juggler".

5   Fail
x = 37; n = 13; y_correct = 34276462; assert(isequal(juggler(x,n),y_correct))

x = 225 x = 3375 x = 196069 x = 86818724 x = 9317 x = 899319 x = 852846071 x = 2.4906e+13 x = 4990602 x = 2233 x = 105519 x = 34276462

Error using VisibleTest5 (line 4) Output argument "y" (and maybe others) not assigned during call to "juggler".

6   Fail
x = 37; n = 18; y_correct = 1; assert(isequal(juggler(x,n),y_correct))

x = 225 x = 3375 x = 196069 x = 86818724 x = 9317 x = 899319 x = 852846071 x = 2.4906e+13 x = 4990602 x = 2233 x = 105519 x = 34276462 x = 5854 x = 76 x = 8 x = 2 x = 1

Error using VisibleTest6 (line 4) Output argument "y" (and maybe others) not assigned during call to "juggler".

7   Fail
x = 37; n = 99; y_correct = 1; assert(isequal(juggler(x,n),y_correct))

x = 225 x = 3375 x = 196069 x = 86818724 x = 9317 x = 899319 x = 852846071 x = 2.4906e+13 x = 4990602 x = 2233 x = 105519 x = 34276462 x = 5854 x = 76 x = 8 x = 2 x = 1 x = 1 x = 1 x = 1 x = 1 x = 1 x = 1 x = 1 x = 1 x = 1 x = 1 x = 1 x = 1 x = 1 x = 1 x = 1 x = 1 x = 1 x = 1 x = 1 x = 1 x = 1 x = 1 x = 1 x = 1 x = 1 x = 1 x = 1 x = 1 x = 1 x = 1 x = 1 x = 1 x = 1 x = 1 x = 1 x = 1 x = 1 x = 1 x = 1 x = 1 x = 1 x = 1 x = 1 x = 1 x = 1 x = 1 x = 1 x = 1 x = 1 x = 1 x = 1 x = 1 x = 1 x = 1 x = 1 x = 1 x = 1 x = 1 x = 1 x = 1 x = 1 x = 1 x = 1 x = 1 x = 1 x = 1 x = 1 x = 1 x = 1 x = 1 x = 1 x = 1 x = 1 x = 1 x = 1 x = 1 x = 1 x = 1 x = 1 x = 1 x = 1

Error using VisibleTest7 (line 4) Output argument "y" (and maybe others) not assigned during call to "juggler".

### Community Treasure Hunt

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

Start Hunting!