It's just as easy to prove a more general result (which is much more useful). The OP is special case
$\ \ a,b\,=\,n\!-\!4,\,n\ $ below $\,\Rightarrow \ p^2\mid n^2+(p\!-\!8)\,n+16\iff p = 2\mid n,\ $ so $\ p\neq 13\ \color{#c00}\checkmark $
Lemma $ $ If $\,p\,$ is $\rm\color{#c00}{prime}$ then $\,p^2\mid a^2\!+pb\iff p\mid a,b\,\smash[]{\overset{\ \rm\color{#0a0}U}\iff}\, p\mid (a,b) $
Proof $\,\ \ (\Leftarrow)\,\ $ Clear. $\,\ \ (\Rightarrow)\ $ $\ p^2\mid a^2\! + pb\,\Rightarrow\, p\mid a^2\color{#c00}{\Rightarrow}\, p\mid a\,$ $\Rightarrow\,p^2\mid a^2\Rightarrow p^2\mid pb\,\Rightarrow\,p\mid b$
The equivalence $\rm\color{#0a0}U$ is a special case of the GCD Universal Property.
Remark $ $ The Lemma is also true for for ${\rm\color{#c00}{squarefree}}\,p\,$ since they are precisely the integers satisfying the above middle inference: $\ p\mid a^2\Rightarrow\,p\mid a,\,$ for all integers $\,a.$