First Long Fibonacci
Fibonacci numbers are built like this: the first two are 1, and each next number is the sum of the two before it. Write a function fibonacci_digit_index that finds the index of the first Fibonacci number containing exactly d digits. Indexing starts from 1, so the first number in the sequence is F1.
Примеры
Ввод
1Вывод
1Ввод
2Вывод
7Ввод
3Вывод
12Нужно реализовать
def fibonacci_digit_index(d: int) -> int:
Теги
math
Logi sisse, et näha esituste ajalugu
Logi sisseLogi sisse, et kasutada AI mentorit
Logi sisseVisible tests
1
Input
1Expected
12
Input
2Expected
73
Input
3Expected
124
Input
1000Expected
47825
Input
100Expected
4766
Input
-1Expected
1Focus radio
Paused · SomaFM · Fluid