F n-1 = round (F n /?)
where? = (? 5 + 1) / 2.
The proof remains as an exercise for the reader; ^ P
Refresh This is incorrect, return to the drawing board.
Update 2 . Calculate back from F n and F n-1 .
F n-2 = F n - F n-1
F n-3 = F n-1 - F n-2 = F n-1 - (F n - F n-1 ) = 2F n-1 - F n
F n-4 = F n-2 - F n-3 = (F n - F n-1 ) - (2F n-1 - F n ) = 2F n - 3F n-1 sub>
F n-5 = F n-3 - F n-4 = (2F n-1 - F n ) - (2F n - 3F n-1 ) = 5F n-1 - 3F psub>
F n-6 = F n-4 - F n-5 = (2F n - 3F n-1 ) - (5F n-1 - 3F n ) = 5F n - 8F n- 1 sub>
Pay attention to the template? It is easy to calculate any member of a sequence from a real Fibonacci sequence and the last two members. But we only know the last member, how can we recognize him to the last?
Write the requirement F i > 0 through F n-1 .
F n-2 = F n - F n-1 > 0 β F n-1 <F <sub> psub>
F n-3 = 2F n-1 - F n > 0 β F n-1 > F <sub> psub> / 2
F n-4 = 2F n - 3F n-1 β F n-1 <2F <sub> psub> / 3
F n-5 = 5F n-1 - 3F n β F n-1 > 3F <sub> psub> / 5
So, we have a sequence of estimates on F n-1 in written terms of a real Fibonacci sequence, each of which is more rigid than the previous one. The last estimate that is still being performed determines F n-1 , which corresponds to the longest sequence. If there is more than one number that satisfies the last boundary, use either the smallest or the largest, depending on whether the sequence has an even or odd length.
For example, if F n = 101, then 101 * 5 / F n-1 <101 * 8/13 β F n-1 = 63
The previous (wrong) solution would imply F n-1 = 62, which is close, but not cigars.
source share