Let $(a_1,...,a_{10})$ be a sequence with $a_i \in \{1,...,10\}$ and the following properties:
$i)$ $a_1\in\{1,...,10\}$
$ii)$ $a_i\neq a_j \ \forall i,j\in \{1,...,10\}$ with $i\neq j$
$iii)$ $a_i\in \{a_1\pm 1,...,a_{i-1}\pm1\}\cap\{1,...,10\} \quad \forall i\in \{2,...,10\}$
How many sequences with these properties exist? Is it possible to generalize this for any $n$ instead of $10$?
I tried looking at the different cases for starting values: For $a_1=\{1,10\}$ there is only one possible sequence each. For $a_1=\{2,9\}$ there are 9 possible seuqences each, because you have 9 possibilities for $1$ or $10$ and the rest of the sequences is clear. But for $a_i=\{3,4,5,6,7\}$ I don't know how to go one with that way of thinking. Can someone give me a hint?
Some extensive hints:
By induction we have $$A_i := \{ a_1, \dotsc, a_i \} = \{ \min A_i, \min A_i + 1, \dotsc, \max A_i \}.$$ Thus, $a_{i+1} = \min A_i - 1$ or $\max A_i + 1$.
You can and must go down exactly $k:=a_1 - 1$ times. Thus, we want to know at which $k$ indices we go down. So basically we count the subsets of $\{1, \dotsc, 9\}$ with $k$ elements (which is well-known).