# Find all integers $n$ such that $\frac{3n^2+4n+5}{2n+1}$ is an integer.

Find all integers $$n$$ such that $$\frac{3n^2+4n+5}{2n+1}$$ is an integer.

Attempt: We have $$\begin{equation*} \frac{3n^2+4n+5}{2n+1} = \frac{4n^2+4n+1 - (n^2-4)}{2n+1} = 2n+1 - \frac{n^2-4}{2n+1}. \end{equation*}$$ So, we must have $$(2n+1) \mid (n^2-4)$$, so $$n^2-4 = k(2n+1)$$, for some $$k \in \Bbb Z$$. But, I did not be able to find $$n$$ from here. Any ideas? Thanks in advanced.

• Hint : $$\frac{3n^2+4n+5}{2n+1}=\frac{1}{4}(6n+5+\frac{15}{2n+1})$$ Apr 10 at 11:56
• Try to use Polynomial Long Division Apr 10 at 11:58
• @Peter Thanks, Sir! Apr 10 at 13:51

First way: Using the Extended Euclidean Algorithm in $$\Bbb Q[x]$$.

Notice that $$\begin{equation*} 15 = 4(3n^2+4n+5) - (6n+5)(2n+1). \end{equation*}$$ Hence, if $$2n+1$$ divides $$3n^2+4n+5$$, then it also divides $$15$$. Thus, $$2n+1 \in \{\pm 1, \pm 3, \pm 5, \pm 15\}$$, i.e., $$\begin{equation*} n \in \{-8,-3,-2,-1,0,1,2,7\}. \end{equation*}$$

Second way: Just using the Elementary number theory.

From your approach, we have $$\begin{equation*} \frac{3n^2+4n+5}{2n+1} = \frac{4n^2+4n+1 - (n^2-4)}{2n+1} = 2n+1 - \frac{n^2-4}{2n+1}. \end{equation*}$$ Now, let $$k=2n+1$$, then $$2n \equiv -1 \pmod{k}. \ldots (1)$$

We want $$(2n+1) \mid (n^2-4)$$, i.e., $$n^2-4 \equiv 0 \pmod{k}. \ldots (2)$$ Multiplying both side in $$(2)$$ by $$4$$, we have \begin{align*} 4n^2 - 16 \equiv 0 \pmod{k} &\Leftrightarrow (2n)^2 - 16 \equiv 0 \pmod{k} \\ &\Leftrightarrow (-1)^2 - 16 \equiv 0 \pmod{k} \qquad \qquad (\text{by (1)}) \\ &\Leftrightarrow -15 \equiv 0 \pmod{k}. \end{align*} Hence, $$2n+1 \mid 15$$. Thus, $$2n+1 \in \{\pm 1, \pm 3, \pm 5, \pm 15\}$$, i.e., $$\begin{equation*} n \in \{-8,-3,-2,-1,0,1,2,7\}. \end{equation*}$$

Now, we are done.

Another approach:

By direct division we find:

$$3n^2+4n+5=(\frac 32 n+\frac 54)(2n+1)+\frac{15}4$$

multiplying both sides by $$4$$ and simplify we get:

$$12n^2+16n+5=(6n+5)(2n+1)$$

Or:

$$\frac{4(3n^2+4n+5)}{2n+1}=6n+5+\frac {15}{2n+1}$$

Therefore $$2n+1$$ must divide $$15$$ that is it must be equal to one of its divisors which are $$\pm 1$$, $$\pm 3$$, $$\pm 5$$ and $$\pm 15$$

1): $$2n+1=1\rightarrow n=0$$, $$2n+1=-1\rightarrow n=-1$$

2): $$2n+1=3\rightarrow n=1$$, $$2n+1=-3 \rightarrow n=-2$$

3): $$2n+1=5\rightarrow n=2$$, $$2n+1=-5 \rightarrow n=-3$$

4): $$2n+1=15 \rightarrow n=7$$, $$2n+1=-15 \rightarrow n=-8$$ so solutions are:

$$0, \pm 1, \pm 2, -3, 7, -8$$

Write $$k=2n+1$$ then $$n=(k-1)/2$$ so $$3n^2+4n+5= {3(k^2-2k+1) + 8(k-1)+20\over 4} ={3k^2+2k+15\over 4}$$ and thus $$4k\mid 3k^2+2k+15\implies k\mid 15$$

Now you have only few values of $$k$$...