Cody

# Problem 44481. How many Fibonacci numbers?

Solution 2057088

Submitted on 13 Dec 2019 by Asif Newaz
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 = [1 4 5 7 10 11 13 20 21 23 29]; y_correct = 4; assert(isequal(fib_count(x),y_correct))

b = 0 1 1 b = 0 1 1 2 3 b = 0 1 1 2 3 5 b = 0 1 1 2 3 5 b = 0 1 1 2 3 5 8 b = 0 1 1 2 3 5 8 b = 0 1 1 2 3 5 8 13 b = 0 1 1 2 3 5 8 13 b = 0 1 1 2 3 5 8 13 21 b = 0 1 1 2 3 5 8 13 21 b = 0 1 1 2 3 5 8 13 21

2   Pass
x = 5:5:100; y_correct = 2; assert(isequal(fib_count(x),y_correct))

b = 0 1 1 2 3 5 b = 0 1 1 2 3 5 8 b = 0 1 1 2 3 5 8 13 b = 0 1 1 2 3 5 8 13 b = 0 1 1 2 3 5 8 13 21 b = 0 1 1 2 3 5 8 13 21 b = 0 1 1 2 3 5 8 13 21 34 b = 0 1 1 2 3 5 8 13 21 34 b = 0 1 1 2 3 5 8 13 21 34 b = 0 1 1 2 3 5 8 13 21 34 b = 0 1 1 2 3 5 8 13 21 34 55 b = 0 1 1 2 3 5 8 13 21 34 55 b = 0 1 1 2 3 5 8 13 21 34 55 b = 0 1 1 2 3 5 8 13 21 34 55 b = 0 1 1 2 3 5 8 13 21 34 55 b = 0 1 1 2 3 5 8 13 21 34 55 b = 0 1 1 2 3 5 8 13 21 34 55 b = 0 1 1 2 3 5 8 13 21 34 55 89 b = 0 1 1 2 3 5 8 13 21 34 55 89 b = 0 1 1 2 3 5 8 13 21 34 55 89

3   Pass
%x = [2 2 3 3 3 3 3 3 5 5 6 6 6 7 86168291600238450732788312165664788095941068326060883324529903470149056115823592713458328176574447204501]; % Changed the test suite to a number that can be represented as an integer in DOUBLE x = [2 2 3 3 3 3 3 3 5 5 6 6 6 7 8944394323791465]; y_correct = 3; assert(isequal(fib_count(x),y_correct))

b = 0 1 1 2 b = 0 1 1 2 3 b = 0 1 1 2 3 5 b = 0 1 1 2 3 5 b = 0 1 1 2 3 5 b = 1.0e+15 * Columns 1 through 18 0 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 Columns 19 through 36 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 Columns 37 through 54 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0001 Columns 55 through 72 0.0001 0.0001 0.0002 0.0004 0.0006 0.0010 0.0015 0.0025 0.0041 0.0066 0.0106 0.0172 0.0278 0.0449 0.0727 0.1177 0.1904 0.3081 Columns 73 through 79 0.4985 0.8065 1.3050 2.1115 3.4165 5.5279 8.9444

4   Pass
x = [2 2 3 3 3 3 3 3 5 5 6 6 6 7 8944394323791464]; y_correct = 4; assert(isequal(fib_count(x),y_correct))

b = 0 1 1 2 b = 0 1 1 2 3 b = 0 1 1 2 3 5 b = 0 1 1 2 3 5 b = 0 1 1 2 3 5 b = 1.0e+15 * Columns 1 through 18 0 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 Columns 19 through 36 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 Columns 37 through 54 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0001 Columns 55 through 72 0.0001 0.0001 0.0002 0.0004 0.0006 0.0010 0.0015 0.0025 0.0041 0.0066 0.0106 0.0172 0.0278 0.0449 0.0727 0.1177 0.1904 0.3081 Columns 73 through 79 0.4985 0.8065 1.3050 2.1115 3.4165 5.5279 8.9444