Returns the index of the first term in the Fibonacci sequence to contain n digits. >>> solution(1000) 4782 >>> solution(100) 476 >>> solution(50) 237 >>> solution(3) 12
(n: int = 1000)
| 81 | |
| 82 | |
| 83 | def solution(n: int = 1000) -> int: |
| 84 | """ |
| 85 | Returns the index of the first term in the Fibonacci sequence to contain |
| 86 | n digits. |
| 87 | |
| 88 | >>> solution(1000) |
| 89 | 4782 |
| 90 | >>> solution(100) |
| 91 | 476 |
| 92 | >>> solution(50) |
| 93 | 237 |
| 94 | >>> solution(3) |
| 95 | 12 |
| 96 | """ |
| 97 | return fibonacci_digits_index(n) |
| 98 | |
| 99 | |
| 100 | if __name__ == "__main__": |
no test coverage detected