Job Recruitment Website - Recruitment portal - How to solve this game algorithm problem?

How to solve this game algorithm problem?

If n is Fibonacci number, there is no winning strategy; If not, there is.

Lemma 1: Any number of homogeneous Kendoff theorems can be expressed as the sum of discontinuous Fibonacci numbers. See Wikipedia homogeneous Kendoff theorem for proof.

Lemma 2: Fibonacci sequence satisfies f (k+ 1) < 2×f(k).

Mathematical induction proves that:

I= 1 does not meet the meaning of the question, so it is not considered.

When i=2, n=2 is obviously a defeat.

When i=3, n=3 is obviously a defeat.

i=k≥3

Suppose i=k,

When i=k+ 1, f(i)=f(k)+f(k? 1), that is, can the subsequent players get f(k? 1) proved the original proposition, and now it is proved as follows:

If x≥ 13f(k? 1), subsequent hands can take the rest of the y=f(k? 1)? x?

And y=f(k? 1)? x & lt23f(k? 1)& lt; 12f(k), that is, the remaining f(k) cannot be taken away by the first hand at one time.

If x≤ 13f(k? 1), there must be f(k? 3)>; 13f(k? 1), the subsequent hand can take f(k-3)-x, and the problem goes back to the previous step.

Then prove the original proposition.

On the other hand, if n is not Fibonacci number, take x first, so that n-x is Fibonacci number, and you win.