Firstly, denote by An the set of all sub-sequences (ai)i=0k of (0,1,2,…,n) such that:
- a0=0,a1=1,ak=n,
- ai+1−ai≤2 for all 0≤i≤k−1.
Obviously, An is one of the sets S satisfying Conditions i)-ii).
It is also clear that ∣A1∣=∣A2∣=1.
If n>2, then for each (ai)i=0k∈An, let us define F((ai)i=0k)=(ai)i=0k−1. In so doing, we have clearly obtained a bijection F:An→An−1∪An−2, hence,
∣An∣=∣An−1∣+∣An−2∣
when n>2. So, ∣An∣ is the nth Fibonacci number, which is denoted by Fn. We will show that Fn is the maximum value of ∣S∣, among all the sets S satisfying Conditions i)-ii). Indeed, for such a set S, we need only prove that
∣S∣≤Fn.
Let S1=S∩An. Then S=S1∪(S\S1). We define a mapping f:S\S1→An by partitioning every w∈S\S1 into parts of the form ( m,m+2,m+3,…,m+2k) or ( m,m+2,m+3,…,m+2k+1 ) in which k≥1 and then f changes each part by the following rule:
(m,m+2,m+3,…,m+2k)↦(m,m+1,m+2,m+4,m+6,…,m+2k)
and
(m,m+2,m+3,…,m+2k+1)↦(m,m+1,m+3,m+5,…,m+2k+1).
We can see that:
- f is one-to-one.
- The two sequences w and f(w) do not satisfy Condition ii); so,
f(w)∈/S∀w∈S\S1.
Hence, S1∩f(S\S1)=∅. Since S1∪f(S\S1)⊂An, it follows that
∣S∣=∣S1∪f(S\S1)∣≤∣An∣=Fn