题目如下:
The Fibonacci sequence is defined by the recurrence relation:
![]()
Hence the first 12 terms will be:
The 12th term, F12, is the first term to contain three digits.
What is the index of the first term in the Fibonacci sequence to contain 1000 digits?
依然采用暴力的方法
t = 1;
while true
if length(char(fibonacci(sym(t)))) >= 1000
break
end
t = t + 1;
end