Except for the first two terms, each term of the sequence 1000,x,1000−x,… is obtained by subtracting the preceding term from the one before that. The last term of the sequence is the first negative term encounted. What positive integer x produces a sequence of maximum length?
解析
Solution
The best way to start is to just write out some terms.
0
1
2
3
4
5
6
1000aa
xaaa
1000−x
2x−1000a
2000−3x5x−30005000−8x
It is now apparent that each term can be written as
n≡0(mod2)Fn−1⋅1000−Fn⋅x
n≡1(mod2)Fn⋅x−Fn−1⋅1000
where the Fn are Fibonacci numbers. This can be proven through induction.
Solution 1
We can start to write out some of the inequalities now:
x>0
1000−x>0⟹x<1000
2x−1000>0⟹x>500
2000−3x>0⟹x<666.6
5x−3000>0⟹x>600
And in general,
n≡0(mod2)x<FnFn−1⋅1000
n≡1(mod2)x>FnFn−1⋅1000
It is apparent that the bounds are slowly closing in on x, so we can just calculate x for some large value of n (randomly, 10, 11):