Divisibility of $n^2+9$ by $n+3$ How would one find all integers $n$ such that $n+3 \vert n^2 +9$? I assume it is important that $(n+3)^2 - 6n = n+3$, but I am struggling to see how you can find all $n$, and confirm an upper bound such that there are no more such $n$.
 A: Clearly, $n+3\mid n^2-9$ holds for every natural $n$. So,$$n+3\mid n^2+9\iff n+3\mid18.$$There aren't many choices for $n$ then.
A: Hint
$$n^2+9=(n+3)^2-6(n+3)+18$$
so
$$\frac{n^2+9}{n+3}=(n+3)-6+\frac{18}{n+3}$$
and then $n+3|18$.
A: Alternatively:
$n+3|n^2+9 \iff$
$n+3|n^2 + 9 - n(n+3)\iff$
$n+3|-3n + 9\iff$
$n+3|-3n + 9 + 3(n+3)\iff$
$n+3|18$
$n+3 = \pm 1; \pm 2;\pm 3;\pm 6;\pm 9;\pm 18$
$-21,-12,-9,-6,-5,-4,-2,-1,0,3,6,15$
A: $\newcommand{\bbx}[1]{\,\bbox[15px,border:1px groove navy]{\displaystyle{#1}}\,}
 \newcommand{\braces}[1]{\left\lbrace\,{#1}\,\right\rbrace}
 \newcommand{\bracks}[1]{\left\lbrack\,{#1}\,\right\rbrack}
 \newcommand{\dd}{\mathrm{d}}
 \newcommand{\ds}[1]{\displaystyle{#1}}
 \newcommand{\expo}[1]{\,\mathrm{e}^{#1}\,}
 \newcommand{\ic}{\mathrm{i}}
 \newcommand{\mc}[1]{\mathcal{#1}}
 \newcommand{\mrm}[1]{\mathrm{#1}}
 \newcommand{\pars}[1]{\left(\,{#1}\,\right)}
 \newcommand{\partiald}[3][]{\frac{\partial^{#1} #2}{\partial #3^{#1}}}
 \newcommand{\root}[2][]{\,\sqrt[#1]{\,{#2}\,}\,}
 \newcommand{\totald}[3][]{\frac{\mathrm{d}^{#1} #2}{\mathrm{d} #3^{#1}}}
 \newcommand{\verts}[1]{\left\vert\,{#1}\,\right\vert}$
\begin{align}
{n^{2} + 9 \over n + 3} & =
{\bracks{\pars{n + 3} - 3}^{\, 2} + 9 \over n + 3} =
{\bracks{\pars{n + 3}^{2} - 6\pars{n + 3} + 9} + 9 \over n + 3} =
\pars{n + 3} - 6 + {18 \over n + 3}
\\[5mm] & =
n - 3 + {18 \over n + 3}
\end{align}

Then, $\ds{\pars{n + 3} \mid \pars{n^{2} + 9}}$ whenever
   $\ds{\pars{n + 3} \mid 18 \implies \exists\ p \in \mathbb{Z}\setminus\braces{0}}$ such that
  $\ds{{18 \over n + 3} = p \implies n = 3\pars{{6 \over p} - 1} \implies p \in \braces{\pm 1,\pm 2,\pm 3,\pm 6} \implies}$
  
  $\ds{\bbx{n \in \color{#f00}{\braces{-21,-12,-9,-6,0,3,6,15}}}}$.

