let σ∈Sn and τ∈Sm with m$\leq$n . We say σ avoid the permutation τ if there are no subset ${j_i< \dots <j_m} \subset [n]$ with:
$\sigma(j_i)<\sigma(j_l) \Leftrightarrow \tau(i)<\tau(l)$ for 1$\leq i \leq m$.
example: if m=3 n=4 and $\tau = 123$ then 4321, 3241 etc avoid $\tau$
Now let $a_n$ be #permutations in $S_n$ that avoid 312 , $a_0=1$
prove that $a_n=a_0a_{n-1} + a_1a_{n-2} \dots + a_{n-1}a_0$