Find all $n \in \mathbb{N}$ such that $(n+2) \mid (n^2+5)$

97 Views Asked by At

I'm trying to find all $n \in \mathbb{N}$ such that

$(n+2) \mid (n^2+5)$

as the title says, I've tried numbers up to $20$ and found that $1, 7$ are solutions and I suspect that those are the only $2$ solutions, however I have no idea how to show that.

I've done nothing but basic transformations:

$(n+2) \mid (n^2+5)$

$\iff n^2+5 = k(n+2)$

$\iff n^2+5 \mod(n+2) = 0$

$\iff (n^2 \mod(n+2) + 5 \mod(n+2)) \mod(n+2) = 0$

Now I suspect the next step is to find all possible solutions for

$n^2 \mod(n+2)$, which I have no idea how to do.

3

There are 3 best solutions below

0
On BEST ANSWER

$$n+2\left|n^2+5\right. \implies k(n+2) = n^2+5 \implies k = \frac{n^2+5}{n+2}$$ Use that $$k = \frac{n^2+5}{n+2}=n-2+\frac{9}{n+2}$$

0
On

$$(n+2)|(n^2-4)$$ Then $$n+2|(n^2+5)-9$$ Then $$n+2|9$$

0
On

$(n+2) \mid (n^2+5)\implies \exists m \in \mathbb N$ such that : $$\frac{n^2+5}{n+2}= m \iff n^2-mn+(5-2m)=0$$

By Solving the quadratic equation in $n$, We get: $$n = \frac{m\pm \sqrt{m^2-20+12m}}{2}$$ Now since $n\in \mathbb N \implies m^2-20+12m$, Must be a perfect square: $$m^2+12m-20 = x^2 \iff (m+6)^2-x^2=56$$ $$(m+6-x)(m+6+x)=56$$ You can look at the Factors of $56$ and try to solve the systems of equations, but you will end up with : $$(m,x) \in \{(9,13), (3,5)\}$$ By Plugging the values of $m$ to the quadratic equation you will get : $$n \in \{1,7\}$$

I think that solving the quadratic equation is extremely useful in questions about perfect squares or divisibility.