Cody

# Problem 43016. Find the next Fibonacci number

Solution 1878224

Submitted on 18 Jul 2019
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
n = 6; out = 8; assert(isequal(next_fibonacci(n),out));

t = 1×52 uint64 row vector Columns 1 through 13 1 1 2 3 5 8 13 21 34 55 89 144 233 Columns 14 through 26 377 610 987 1597 2584 4181 6765 10946 17711 28657 46368 75025 121393 Columns 27 through 39 196418 317811 514229 832040 1346269 2178309 3524578 5702887 9227465 14930352 24157817 39088169 63245986 Columns 40 through 52 102334155 165580141 267914296 433494437 701408733 1134903170 1836311903 2971215073 4807526976 7778742049 12586269025 20365011074 32951280099

Output argument "y" (and maybe others) not assigned during call to "next_fibonacci". Error in Test1 (line 3) assert(isequal(next_fibonacci(n),out));

2   Fail
n = [12 40 50]; out = [13 55 55]; assert(isequal(next_fibonacci(n),out));

t = 1×52 uint64 row vector Columns 1 through 13 1 1 2 3 5 8 13 21 34 55 89 144 233 Columns 14 through 26 377 610 987 1597 2584 4181 6765 10946 17711 28657 46368 75025 121393 Columns 27 through 39 196418 317811 514229 832040 1346269 2178309 3524578 5702887 9227465 14930352 24157817 39088169 63245986 Columns 40 through 52 102334155 165580141 267914296 433494437 701408733 1134903170 1836311903 2971215073 4807526976 7778742049 12586269025 20365011074 32951280099

Output argument "y" (and maybe others) not assigned during call to "next_fibonacci". Error in Test2 (line 3) assert(isequal(next_fibonacci(n),out));

3   Fail
n = 10.^(1:5); out = [13 144 1597 10946 121393]; assert(isequal(next_fibonacci(n),out));

t = 1×52 uint64 row vector Columns 1 through 13 1 1 2 3 5 8 13 21 34 55 89 144 233 Columns 14 through 26 377 610 987 1597 2584 4181 6765 10946 17711 28657 46368 75025 121393 Columns 27 through 39 196418 317811 514229 832040 1346269 2178309 3524578 5702887 9227465 14930352 24157817 39088169 63245986 Columns 40 through 52 102334155 165580141 267914296 433494437 701408733 1134903170 1836311903 2971215073 4807526976 7778742049 12586269025 20365011074 32951280099

Output argument "y" (and maybe others) not assigned during call to "next_fibonacci". Error in Test3 (line 3) assert(isequal(next_fibonacci(n),out));

4   Fail
n = round(7.^(3:.5:7)); out = [377 987 2584 6765 17711 46368 121393 317811 832040]; assert(isequal(next_fibonacci(n),out));

t = 1×52 uint64 row vector Columns 1 through 13 1 1 2 3 5 8 13 21 34 55 89 144 233 Columns 14 through 26 377 610 987 1597 2584 4181 6765 10946 17711 28657 46368 75025 121393 Columns 27 through 39 196418 317811 514229 832040 1346269 2178309 3524578 5702887 9227465 14930352 24157817 39088169 63245986 Columns 40 through 52 102334155 165580141 267914296 433494437 701408733 1134903170 1836311903 2971215073 4807526976 7778742049 12586269025 20365011074 32951280099

Output argument "y" (and maybe others) not assigned during call to "next_fibonacci". Error in Test4 (line 3) assert(isequal(next_fibonacci(n),out));