Cody

# Problem 42841. Return the sequence element III

Solution 2635330

Submitted on 30 Jun 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
x1 = 1; x2 = 2; n = 5; y_correct = 6; assert(isequal(ulam(x1,x2,n),y_correct))

a = 3 m1 = 0 1 0 m2 = 2 3 4 a = 3 m1 = 0 1 0 m2 = 2 3 4 a = 3 m1 = 0 1 0 m2 = 2 3 4 a = 3 m1 = 0 1 0 m2 = 2 3 4 a = 3 m1 = 0 1 0 m2 = 2 3 4

Output argument "y" (and maybe others) not assigned during call to "ulam". Error in Test1 (line 5) assert(isequal(ulam(x1,x2,n),y_correct))

2   Fail
x1 = 1; x2 = 2; n = 22; y_correct = 77; assert(isequal(ulam(x1,x2,n),y_correct))

a = 3 m1 = 0 1 0 m2 = 2 3 4 a = 3 m1 = 0 1 0 m2 = 2 3 4 a = 3 m1 = 0 1 0 m2 = 2 3 4 a = 3 m1 = 0 1 0 m2 = 2 3 4 a = 3 m1 = 0 1 0 m2 = 2 3 4 a = 3 m1 = 0 1 0 m2 = 2 3 4 a = 3 m1 = 0 1 0 m2 = 2 3 4 a = 3 m1 = 0 1 0 m2 = 2 3 4 a = 3 m1 = 0 1 0 m2 = 2 3 4 a = 3 m1 = 0 1 0 m2 = 2 3 4 a = 3 m1 = 0 1 0 m2 = 2 3 4 a = 3 m1 = 0 1 0 m2 = 2 3 4 a = 3 m1 = 0 1 0 m2 = 2 3 4 a = 3 m1 = 0 1 0 m2 = 2 3 4 a = 3 m1 = 0 1 0 m2 = 2 3 4 a = 3 m1 = 0 1 0 m2 = 2 3 4 a = 3 m1 = 0 1 0 m2 = 2 3 4 a = 3 m1 = 0 1 0 m2 = 2 3 4 a = 3 m1 = 0 1 0 m2 = 2 3 4 a = 3 m1 = 0 1 0 m2 = 2 3 4 a = 3 m1 = 0 1 0 m2 = 2 3 4 a = 3 m1 = 0 1 0 m2 = 2 3 4

Output argument "y" (and maybe others) not assigned during call to "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 4 5 a = 4 m1 = 0 0 1 0 m2 = 2 3 4 5 a = 4 m1 = 0 0 1 0 m2 = 2 3 4 5 a = 4 m1 = 0 0 1 0 m2 = 2 3 4 5 a = 4 m1 = 0 0 1 0 m2 = 2 3 4 5 a = 4 m1 = 0 0 1 0 m2 = 2 3 4 5 a = 4 m1 = 0 0 1 0 m2 = 2 3 4 5 a = 4 m1 = 0 0 1 0 m2 = 2 3 4 5 a = 4 m1 = 0 0 1 0 m2 = 2 3 4 5 a = 4 m1 = 0 0 1 0 m2 = 2 3 4 5 a = 4 m1 = 0 0 1 0 m2 = 2 3 4 5 a = 4 m1 = 0 0 1 0 m2 = 2 3 4 5 a = 4 m1 = 0 0 1 0 m2 = 2 3 4 5 a = 4 m1 = 0 0 1 0 m2 = 2 3 4 5 a = 4 m1 = 0 0 1 0 m2 = 2 3 4 5 a = 4 m1 = 0 0 1 0 m2 = 2 3 4 5 a = 4 m1 = 0 0 1 0 m2 = 2 3 4 5 a = 4 m1 = 0 0 1 0 m2 = 2 3 4 5 a = 4 m1 = 0 0 1 0 m2 = 2 3 4 5 a = 4 m1 = 0 0 1 0 m2 = 2 3 4 5

Output argument "y" (and maybe others) not assigned during call to "ulam". Error in Test3 (line 5) assert(isequal(ulam(x1,x2,n),y_correct))

4   Fail
x1 = 1; x2 = 5; n = 10; y_correct = 22; assert(isequal(ulam(x1,x2,n),y_correct))

a = 6 m1 = 0 0 0 1 0 0 m2 = 3 4 5 6 7 8 a = 6 m1 = 0 0 0 1 0 0 m2 = 3 4 5 6 7 8 a = 6 m1 = 0 0 0 1 0 0 m2 = 3 4 5 6 7 8 a = 6 m1 = 0 0 0 1 0 0 m2 = 3 4 5 6 7 8 a = 6 m1 = 0 0 0 1 0 0 m2 = 3 4 5 6 7 8 a = 6 m1 = 0 0 0 1 0 0 m2 = 3 4 5 6 7 8 a = 6 m1 = 0 0 0 1 0 0 m2 = 3 4 5 6 7 8 a = 6 m1 = 0 0 0 1 0 0 m2 = 3 4 5 6 7 8 a = 6 m1 = 0 0 0 1 0 0 m2 = 3 4 5 6 7 8 a = 6 m1 = 0 0 0 1 0 0 m2 = 3 4 5 6 7 8

Output argument "y" (and maybe others) not assigned during call to "ulam". Error in Test4 (line 5) assert(isequal(ulam(x1,x2,n),y_correct))

5   Fail
x1 = 2; x2 = 9; n = 8; y_correct = 20; assert(isequal(ulam(x1,x2,n),y_correct))

a = 11 m1 = 0 0 0 0 0 1 0 0 0 0 0 m2 = 6 7 8 9 10 11 12 13 14 15 16 a = 11 m1 = 0 0 0 0 0 1 0 0 0 0 0 m2 = 6 7 8 9 10 11 12 13 14 15 16 a = 11 m1 = 0 0 0 0 0 1 0 0 0 0 0 m2 = 6 7 8 9 10 11 12 13 14 15 16 a = 11 m1 = 0 0 0 0 0 1 0 0 0 0 0 m2 = 6 7 8 9 10 11 12 13 14 15 16 a = 11 m1 = 0 0 0 0 0 1 0 0 0 0 0 m2 = 6 7 8 9 10 11 12 13 14 15 16 a = 11 m1 = 0 0 0 0 0 1 0 0 0 0 0 m2 = 6 7 8 9 10 11 12 13 14 15 16 a = 11 m1 = 0 0 0 0 0 1 0 0 0 0 0 m2 = 6 7 8 9 10 11 12 13 14 15 16 a = 11 m1 = 0 0 0 0 0 1 0 0 0 0 0 m2 = 6 7 8 9 10 11 12 13 14 15 16

Output argument "y" (and maybe others) not assigned during call to "ulam". Error in Test5 (line 5) assert(isequal(ulam(x1,x2,n),y_correct))

6   Fail
x1 = 2; x2 = 9; n = 26; y_correct = 77; assert(isequal(ulam(x1,x2,n),y_correct))

a = 11 m1 = 0 0 0 0 0 1 0 0 0 0 0 m2 = 6 7 8 9 10 11 12 13 14 15 16 a = 11 m1 = 0 0 0 0 0 1 0 0 0 0 0 m2 = 6 7 8 9 10 11 12 13 14 15 16 a = 11 m1 = 0 0 0 0 0 1 0 0 0 0 0 m2 = 6 7 8 9 10 11 12 13 14 15 16 a = 11 m1 = 0 0 0 0 0 1 0 0 0 0 0 m2 = 6 7 8 9 10 11 12 13 14 15 16 a = 11 m1 = 0 0 0 0 0 1 0 0 0 0 0 m2 = 6 7 8 9 10 11 12 13 14 15 16 a = 11 m1 = 0 0 0 0 0 1 0 0 0 0 0 m2 = 6 7 8 9 10 11 12 13 14 15 16 a = 11 m1 = 0 0 0 0 0 1 0 0 0 0 0 m2 = 6 7 8 9 10 11 12 13 14 15 16 a = 11 m1 = 0 0 0 0 0 1 0 0 0 0 0 m2 = 6 7 8 9 10 11 12 13 14 15 16 a = 11 m1 = 0 0 0 0 0 1 0 0 0 0 0 m2 = 6 7 8 9 10 11 12 13 14 15 16 a = 11 m1 = 0 0 0 0 0 1 0 0 0 0 0 m2 = 6 7 8 9 10 11 12 13 14 15 16 a = 11 m1 = 0 0 0 0 0 1 0 0 0 0 0 m2 = 6 7 8 9 10 11 12 13 14 15 16 a = 11 m1 = 0 0 0 0 0 1 0 0 0 0 0 m2 = 6 7 8 9 10 11 12 13 14 15 16 a = 11 m1 = 0 0 0 0 0 1 0 0 0 0 0 m2 = 6 7 8 9 10 11 12 13 14 15 16 a = 11 m1 = 0 0 0 0 0 1 0 0 0 0 0 m2 = 6 7 8 9 10 11 12 13 14 15 16 a = 11 m1 = 0 0 0 0 0 1 0 0 0 0 0 m2 = 6 7 8 9 10 11 12 13 14 15 16 a = 11 m1 = 0 0 0 0 0 1 0 0 0 0 0 m2 = 6 7 8 9 10 11 12 13 14 15 16 a = 11 m1 = 0 0 0 0 0 1 0 0 0 0 0 m2 = 6 7 8 9 10 11 12 13 14 15 16 a = 11 m1 = 0 0 0 0 0 1 0 0 0 0 0 m2 = 6 7 8 9 10 11 12 13 14 15 16 a = 11 m1 = 0 0 0 0 0 1 0 0 0 0 0 m2 = 6 7 8 9 10 11 12 13 14 15 16 a = 11 m1 = 0 0 0 0 0 1 0 0 0 0 0 m2 = 6 7 8 9 10 11 12 13 14 15 16 a = 11 m1 = 0 0 0 0 0 1 0 0 0 0 0 m2 = 6 7 8 9 10 11 12 13 14 15 16 a = 11 m1 = 0 0 0 0 0 1 0 0 0 0 0 m2 = 6 7 8 9 10 11 12 13 14 15 16 a = 11 m1 = 0 0 0 0 0 1 0 0 0 0 0 m2 = 6 7 8 9 10 11 12 13 14 15 16 a = 11 m1 = 0 0 0 0 0 1 0 0 0 0 0 m2 = 6 7 8 9 10 11 12 13 14 15 16 a = 11 m1 = 0 0 0 0 0 1 0 0 0 0 0 m2 = 6 7 8 9 10 11 12 13 14 15 16 a = 11 m1 = 0 0 0 0 0 1 0 0 0 0 0 m2 = 6 7 8 9 10 11 12 13 14 15 16

Output argument "y" (and maybe others) not assigned during call to "ulam". Error in Test6 (line 5) assert(isequal(ulam(x1,x2,n),y_correct))

7   Fail
x1 = 4; x2 = 5; n = 29; y_correct = 123; assert(isequal(ulam(x1,x2,n),y_correct))

a = 9 m1 = 0 0 0 0 1 0 0 0 0 m2 = 5 6 7 8 9 10 11 12 13 a = 9 m1 = 0 0 0 0 1 0 0 0 0 m2 = 5 6 7 8 9 10 11 12 13 a = 9 m1 = 0 0 0 0 1 0 0 0 0 m2 = 5 6 7 8 9 10 11 12 13 a = 9 m1 = 0 0 0 0 1 0 0 0 0 m2 = 5 6 7 8 9 10 11 12 13 a = 9 m1 = 0 0 0 0 1 0 0 0 0 m2 = 5 6 7 8 9 10 11 12 13 a = 9 m1 = 0 0 0 0 1 0 0 0 0 m2 = 5 6 7 8 9 10 11 12 13 a = 9 m1 = 0 0 0 0 1 0 0 0 0 m2 = 5 6 7 8 9 10 11 12 13 a = 9 m1 = 0 0 0 0 1 0 0 0 0 m2 = 5 6 7 8 9 10 11 12 13 a = 9 m1 = 0 0 0 0 1 0 0 0 0 m2 = 5 6 7 8 9 10 11 12 13 a = 9 m1 = 0 0 0 0 1 0 0 0 0 m2 = 5 6 7 8 9 10 11 12 13 a = 9 m1 = 0 0 0 0 1 0 0 0 0 m2 = 5 6 7 8 9 10 11 12 13 a = 9 m1 = 0 0 0 0 1 0 0 0 0 m2 = 5 6 7 8 9 10 11 12 13 a = 9 m1 = 0 0 0 0 1 0 0 0 0 m2 = 5 6 7 8 9 10 11 12 13 a = 9 m1 = 0 0 0 0 1 0 0 0 0 m2 = 5 6 7 8 9 10 11 12 13 a = 9 m1 = 0 0 0 0 1 0 0 0 0 m2 = 5 6 7 8 9 10 11 12 13 a = 9 m1 = 0 0 0 0 1 0 0 0 0 m2 = 5 6 7 8 9 10 11 12 13 a = 9 m1 = 0 0 0 0 1 0 0 0 0 m2 = 5 6 7 8 9 10 11 12 13 a = 9 m1 = 0 0 0 0 1 0 0 0 0 m2 = 5 6 7 8 9 10 11 12 13 a = 9 m1 = 0 0 0 0 1 0 0 0 0 m2 = 5 6 7 8 9 10 11 12 13 a = 9 m1 = 0 0 0 0 1 0 0 0 0 m2 = 5 6 7 8 9 10 11 12 13 a = 9 m1 = 0 0 0 0 1 0 0 0 0 m2 = 5 6 7 8 9 10 11 12 13 a = 9 m1 = 0 0 0 0 1 0 0 0 0 m2 = 5 6 7 8 9 10 11 12 13 a = 9 m1 = 0 0 0 0 1 0 0 0 0 m2 = 5 6 7 8 9 10 11 12 13 a = 9 m1 = 0 0 0 0 1 0 0 0 0 m2 = 5 6 7 8 9 10 11 12 13 a = 9 m1 = 0 0 0 0 1 0 0 0 0 m2 = 5 6 7 8 9 10 11 12 13 a = 9 m1 = 0 0 0 0 1 0 0 0 0 m2 = 5 6 7 8 9 10 11 12 13 a = 9 m1 = 0 0 0 0 1 0 0 0 0 m2 = 5 6 7 8 9 10 11 12 13 a = 9 m1 = 0 0 0 0 1 0 0 0 0 m2 = 5 6 7 8 9 10 11 12 13 a = 9 m1 = 0 0 0 0 1 0 0 0 0 m2 = 5 6 7 8 9 10 11 12 13

Output argument "y" (and maybe others) not assigned during call to "ulam". Error in Test7 (line 5) assert(isequal(ulam(x1,x2,n),y_correct))

8   Fail
x1 = 6; x2 = 7; n = 29; y_correct = 123; assert(isequal(ulam(x1,x2,n),y_correct))

a = 13 m1 = 0 0 0 0 0 0 1 0 0 0 0 0 0 m2 = 7 8 9 10 11 12 13 14 15 16 17 18 19 a = 13 m1 = 0 0 0 0 0 0 1 0 0 0 0 0 0 m2 = 7 8 9 10 11 12 13 14 15 16 17 18 19 a = 13 m1 = 0 0 0 0 0 0 1 0 0 0 0 0 0 m2 = 7 8 9 10 11 12 13 14 15 16 17 18 19 a = 13 m1 = 0 0 0 0 0 0 1 0 0 0 0 0 0 m2 = 7 8 9 10 11 12 13 14 15 16 17 18 19 a = 13 m1 = 0 0 0 0 0 0 1 0 0 0 0 0 0 m2 = 7 8 9 10 11 12 13 14 15 16 17 18 19 a = 13 m1 = 0 0 0 0 0 0 1 0 0 0 0 0 0 m2 = 7 8 9 10 11 12 13 14 15 16 17 18 19 a = 13 m1 = 0 0 0 0 0 0 1 0 0 0 0 0 0 m2 = 7 8 9 10 11 12 13 14 15 16 17 18 19 a = 13 m1 = 0 0 0 0 0 0 1 0 0 0 0 0 0 m2 = 7 8 9 10 11 12 13 14 15 16 17 18 19 a = 13 m1 = 0 0 0 0 0 0 1 0 0 0 0 0 0 m2 = 7 8 9 10 11 12 13 14 15 16 17 18 19 a = 13 m1 = 0 0 0 0 0 0 1 0 0 0 0 0 0 m2 = 7 8 9 10 11 12 13 14 15 16 17 18 19 a = 13 m1 = 0 0 0 0 0 0 1 0 0 0 0 0 0 m2 = 7 8 9 10 11 12 13 14 15 16 17 18 19 a = 13 m1 = 0 0 0 0 0 0 1 0 0 0 0 0 0 m2 = 7 8 9 10 11 12 13 14 15 16 17 18 19 a = 13 m1 = 0 0 0 0 0 0 1 0 0 0 0 0 0 m2 = 7 8 9 10 11 12 13 14 15 16 17 18 19 a = 13 m1 = 0 0 0 0 0 0 1 0 0 0 0 0 0 m2 = 7 8 9 10 11 12 13 14 15 16 17 18 19 a = 13 m1 = 0 0 0 0 0 0 1 0 0 0 0 0 0 m2 = 7 8 9 10 11 12 13 14 15 16 17 18 19 a = 13 m1 = 0 0 0 0 0 0 1 0 0 0 0 0 0 m2 = 7 8 9 10 11 12 13 14 15 16 17 18 19 a = 13 m1 = 0 0 0 0 0 0 1 0 0 0 0 0 0 m2 = 7 8 9 10 11 12 13 14 15 16 17 18 19 a = 13 m1 = 0 0 0 0 0 0 1 0 0 0 0 0 0 m2 = 7 8 9 10 11 12 13 14 15 16 17 18 19 a = 13 m1 = 0 0 0 0 0 0 1 0 0 0 0 0 0 m2 = 7 8 9 10 11 12 13 14 15 16 17 18 19 a = 13 m1 = 0 0 0 0 0 0 1 0 0 0 0 0 0 m2 = 7 8 9 10 11 12 13 14 15 16 17 18 19 a = 13 m1 = 0 0 0 0 0 0 1 0 0 0 0 0 0 m2 = 7 8 9 10 11 12 13 14 15 16 17 18 19 a = 13 m1 = 0 0 0 0 0 0 1 0 0 0 0 0 0 m2 = 7 8 9 10 11 12 13 14 15 16 17 18 19 a = 13 m1 = 0 0 0 0 0 0 1 0 0 0 0 0 0 m2 = 7 8 9 10 11 12 13 14 15 16 17 18 19 a = 13 m1 = 0 0 0 0 0 0 1 0 0 0 0 0 0 m2 = 7 8 9 10 11 12 13 14 15 16 17 18 19 a = 13 m1 = 0 0 0 0 0 0 1 0 0 0 0 0 0 m2 = 7 8 9 10 11 12 13 14 15 16 17 18 19 a = 13 m1 = 0 0 0 0 0 0 1 0 0 0 0 0 0 m2 = 7 8 9 10 11 12 13 14 15 16 17 18 19 a = 13 m1 = 0 0 0 0 0 0 1 0 0 0 0 0 0 m2 = 7 8 9 10 11 12 13 14 15 16 17 18 19 a = 13 m1 = 0 0 0 0 0 0 1 0 0 0 0 0 0 m2 = 7 8 9 10 11 12 13 14 15 16 17 18 19 a = 13 m1 = 0 0 0 0 0 0 1 0 0 0 0 0 0 m2 = 7 8 9 10 11 12 13 14 15 16 17 18 19

Output argument "y" (and maybe others) not assigned during call to "ulam". Error in Test8 (line 5) assert(isequal(ulam(x1,x2,n),y_correct))