Problem (Combinatorics):
For each positive integer $N$, an Eden sequence from $\{1,2,3, \ldots, N\}$ is defined to be a sequence that satisfies the following conditions:

(i) each of its terms is an element of the set of consecutive integers $\{1,2,3, \ldots, N\}$,

(ii) the sequence is increasing, and

(iii) the terms in odd numbered positions are odd and the terms in even numbered positions are even.

For example, the four Eden sequences from $\{1,2,3\}$ are

$$
\begin{array}{llll}
1 & 3 & 1,2 & 1,2,3
\end{array}
$$
For each positive integer $N$, define $e(N)$ to be the number of Eden sequences from $\{1,2,3, \ldots, N\}$. If $e(17)=4180$ and $e(20)=17710$, determine $e(18)$ and $e(19)$.

Solution:
We will prove that, for all positive integers $n \geq 3$, we have $e(n)=e(n-1)+e(n-2)+1$. Thus, if $e(18)=m$, then $e(19)=e(18)+e(17)+1=m+4181$ and

$$
e(20)=e(19)+e(18)+1=(m+4181)+m+1
$$

Since $e(20)=17710$, then $17710=2 m+4182$ or $2 m=13528$ and so $m=6764$.

Therefore, $e(18)=6764$ and $e(19)=6764+4181=10945$.

So we must prove that, for all positive integers $n \geq 3$, we have $e(n)=e(n-1)+e(n-2)+1$.

To simplify the reading, we use a number of abbreviations:

* ES means "Eden sequence"

$* \operatorname{ES}(m)$ means "Eden sequence from $\{1,2,3, \ldots, m\}$

* ESE and ESO mean "Eden sequence of even length" and "Eden sequence of odd length", respectively
* $\operatorname{ESE}(m)$ and $\operatorname{ESO}(m)$ mean "Eden sequence of even length from $\{1,2,3, \ldots, m\}$ " and "Eden sequence of odd length from $\{1,2,3, \ldots, m\}$ ", respectively


Method 1 

For each positive integer $n$, let $A(n)$ be the number of $\operatorname{ESE}(n)$, and let $B(n)$ be the number of $\operatorname{ESO}(n)$.

Then $e(n)=A(n)+B(n)$ for each positive integer $n$.

Note also that for each positive integer $n \geq 2$, we have $e(n) \geq e(n-1)$ and $A(n) \geq A(n-1)$ and $B(n) \geq B(n-1)$. This is because every $\operatorname{ES}(n-1)$ is also an $\operatorname{ES}(n)$ because it satisfies the three required conditions. So there are at least as many $\operatorname{ES}(n)$ as there are $\operatorname{ES}(n-1)$. (The same argument works to show that there are at least as many $\operatorname{ESE}(n)$ as there are $\operatorname{ESE}(n-1)$, and at least as many $\operatorname{ESO}(n)$ as there are $\operatorname{ESO}(n-1)$.

Note that if $k$ is a positive integer, then $2 k+1$ is odd and $2 k$ is even.

The following four facts are true for every positive integer $k \geq 1$ :



(i) $A(2 k+1)=A(2 k)$

(ii) $B(2 k)=B(2 k-1)$

(iii) $A(2 k)=A(2 k-1)+B(2 k-1)$

(iv) $B(2 k+1)=A(2 k)+B(2 k)+1$

Here are justifications for these facts:

(i) An ESE must end with an even integer. Thus, an $\operatorname{ESE}(2 k+1)$ cannot include $2 k+1$, since it would then have to include a larger even positive integer, which it cannot. Therefore, an $\operatorname{ESE}(2 k+1)$ has largest term at most $2 k$ and so is an $\operatorname{ES}(2 k)$.

Thus, $A(2 k+1) \leq A(2 k)$.

But from above, $A(2 k+1) \geq A(2 k)$, and so $A(2 k+1)=A(2 k)$.

(ii) An ESO must end with an odd integer. Thus, an $\operatorname{ESO}(2 k)$ cannot include $2 k$, since it would then have to include a larger odd positive integer, which it cannot. Therefore, an $\operatorname{ESO}(2 k)$ has largest term at most $2 k-1$ and so is an $\operatorname{ESO}(2 k-1)$. Thus, $B(2 k) \leq B(2 k-1)$.

But from above, $B(2 k) \geq B(2 k-1)$, and so $B(2 k)=B(2 k-1)$.

(iii) An $\operatorname{ESE}(2 k)$ either includes $2 k$ or does not include $2 k$.

If such a sequence includes $2 k$, then removing the $2 k$ produces an $\operatorname{ESO}(2 k-1)$. Also, every $\operatorname{ESO}(2 k-1)$ can be produced in this way.

Therefore, the number of sequences in this case is $B(2 k-1)$.

If such a sequence does not include $2 k$, then the sequence can be thought of as an $\operatorname{ESE}(2 k-1)$. Note that every $\operatorname{ESE}(2 k-1)$ is an $\operatorname{ESE}(2 k)$.

Therefore, the number of sequences in this case is $A(2 k-1)$.

Thus, $A(2 k)=A(2 k-1)+B(2 k-1)$.

(iv) $\operatorname{An} \operatorname{ESO}(2 k+1)$ is either the one term sequence $2 k+1$, or includes $2 k+1$ and more terms, or does not include $2 k+1$.

There is 1 sequence of the first kind.

As in (iii), there are $A(2 k)$ sequences of the second kind and $B(2 k)$ sequences of the third kind.

Thus, $B(2 k+1)=1+A(2 k)+B(2 k)$.

Combining these facts, for each positive integer $k$, we obtain

$$
\begin{aligned}
e(2 k+1) & =A(2 k+1)+B(2 k+1) \\
& =A(2 k)+(A(2 k)+B(2 k)+1) \\
& =(A(2 k)+B(2 k))+A(2 k)+1 \\
& =e(2 k)+(A(2 k-1)+B(2 k-1))+1 \\
& =e(2 k)+e(2 k-1)+1
\end{aligned}
$$

and

$$
\begin{aligned}
e(2 k) & =A(2 k)+B(2 k) \\
& =(A(2 k-1)+B(2 k-1))+B(2 k-1) \\
& =e(2 k-1)+(A(2 k-2)+B(2 k-2)+1) \\
& =e(2 k-1)+e(2 k-2)+1
\end{aligned}
$$

Therefore, for all positive integers $n \geq 3$, we have $e(n)=e(n-1)+e(n-2)+1$, as required.



Method 2 

Let $n$ be a positive integer with $n \geq 3$, and consider the $\operatorname{ES}(n)$.

We divide the sequences into three sets:

(i) The sequence 1 (there is 1 such sequence)

(ii) The sequences which begin with 1 and have more than 1 term

(iii) The sequences which do not begin with 1

We show that in case (ii) there are $e(n-1)$ sequences and in case (iii) there are $e(n-2)$ sequences. This will show that $e(n)=1+e(n-1)+e(n-2)$, as required.

(ii) Consider the set of $\operatorname{ES}(n)$ that begin with 1 . We call this set of sequences $P$.

We remove the 1 from each of these and consider the set of resulting sequences. We call this set $Q$. Note that the number of sequences in $P$ and in $Q$ is the same.

Each of the sequences in $Q$ includes numbers from the set $\{2,3, \ldots, n\}$, is increasing, and has even terms in odd positions and odd terms in even positions (since each term has been shifted one position to the left).

The sequences in $Q$ are in a one-to-one correspondence with the $\operatorname{ES}(n-1)$ (we call this set of sequences $R$ ) and so there are exactly $e(n-1)$ of them (and so $e(n-1)$ sequences in $P$ ).

We can show that this one-to-one correspondence exists by subtracting 1 from each term of each sequence in $Q$, to form a set of sequences $S$. Each of the resulting sequences is distinct, includes numbers from the set $\{1,2,3, \ldots, n-1\}$, is increasing, and has odd terms in odd positions and even terms in even positions (since each term has been reduced by 1). Also, each sequence in $R$ can be obtained in this way (since adding 1 to each term in one of these ES gives a distinct sequence in $Q$ ).

Therefore, the number of sequences in this case is $e(n-1)$.

(iii) Consider the set of $\operatorname{ES}(n)$ that do not begin with 1 . We call this set of sequences $T$. Since each sequence in $T$ does not begin with 1 , then the minimum number in each sequence is 3 .

Thus, each of the sequences in $T$ includes numbers from the set $\{3,4, \ldots, n\}$, is increasing, and has odd terms in odd positions and even terms in even positions.

The sequences in $T$ are in a one-to-one correspondence with the $\mathrm{ES}(n-2)$ (we call this set of sequences $U$ ) and so there are exactly $e(n-2)$ of them.

We can show that this one-to-one correspondence exists by subtracting 2 from each term of each sequence in $T$, to form a set of sequences $V$. Each of the resulting sequences is distinct, includes numbers from the set $\{1,2,3, \ldots, n-2\}$, is increasing, and has odd terms in odd positions and even terms in even positions (since each term has been reduced by 2). Also, each sequence in $U$ can be obtained in this way (since adding 2 to each term in one of these $\mathrm{ES}$ gives a distinct sequence in $U$ ).

Therefore, the number of sequences in this case is $e(n-2)$.

This concludes our proof and shows that $e(n)=1+e(n-1)+e(n-2)$, as required.

Final answer: $6764$,$10945$