Solution (source code)

= Solution

Multiplication by $e^{-im\theta}$ and summation over $m\in\mathbb Z$ give
$$
\sum_m e^{-im\theta}u^n_{m+k}
=e^{ik\theta}\widehat u^{\,n}(\theta).
$$
Thus the recurrence becomes
$$
A(\theta)\widehat u^{\,n+1}(\theta)
=B(\theta)\widehat u^{\,n}(\theta),
$$
where
$$
A(\theta)=\sum_{k=r}^sa_ke^{ik\theta},
\qquad
B(\theta)=\sum_{k=r}^sb_ke^{ik\theta}.
$$
Assuming $A(\theta)\ne0$, the <amplification factor of a two-sided one-step stencil> is
$$
\boxed{
H(\theta)=\frac{B(\theta)}{A(\theta)}
=\frac{\sum_{k=r}^sb_ke^{ik\theta}}
{\sum_{k=r}^sa_ke^{ik\theta}}
}.
$$