If $d \mid n-1$ and $d \mid n^2+2$, show that $d\mid3$
Attempt:
$n-1=\alpha d \tag 1$
$n^2+2=\beta d \tag 2$
for some $\alpha,\beta$.
Now we must show $3=\gamma d$ for some $\gamma$.
Adding (1) and (2), we get $$n^2+n+1=(\alpha+\beta)d = \gamma d$$
I'm having some trouble from here onwards. Have I done the steps correctly thus far? Thanks!
$d$ divides $n^2+2-(n-1)=n^2-n+3=n(n-1)+3$ this implies that $d$ divides $3$ since it divides $n(n-1)$.
$(n-1)=ad, n^2+2=bd$ implies that $n^2+2-(n-1)=bd-ad=n(n-1)+3=and+3$ implies that $and+3=(b-a)d$ and $3=(b-a-an)d$.