Solution (source code)

= Solution

The centered model has residual sum of squares
$$
\sum_i\{Y_i-\alpha'-\beta'(x_i-\bar x)\}^2.
$$
Its slope normal equation gives
$$
\hat\beta'
=\frac{\sum_i(x_i-\bar x)(Y_i-\bar Y)}
{\sum_i(x_i-\bar x)^2}
=\boxed{\hat\beta}.
$$