# Find all positive solutions such that $n^2 + 9n +1$ is a perfect square

My Attempt

$n^2 + 9n +1$ is obviously not a perfect square when it is in between consecutive squares, or: $n^2 + 8n +16 < n^2 + 9n +1 <n^2 + 10n +25$

The second inequality is always true. Solving the first inequality, we get it is not true when $n \le 15$. So we check for possible values less than 16. On working mod 3, we get that $n$ must be a multiple of $3$. So possible candidates are $3,6,9,12$ and $15$. On working out, $n=15$ is the only solution.

I inquire if there are any other shorter methods, or methods which are usually done, like taking the discriminant of the expression or by modular arithmetic. I tried the first method and proved that there is integral $n$ when $\sqrt {77+4c}$ is integral ( Where $c= n^2 + 9n +1$) It works mod 4, and I couldn't continue. I am not sure modular arithmetic would work, as 15 is the only solution, but I would like to know of any other, even if it is reasonably longer than my method. Thanks in advance.

• What set is n in ? You seem to imply that 15 is the only solution but another (obvious) one would be 0 since $0^2 + 9 *0 +1 = 1^2$ – Astyx Oct 16 '16 at 12:21
• @Astyx 0 is not a positive solution – Benson Lin Oct 16 '16 at 12:21

We know that:

$$(n+1)^2 = n^2 + 2n +1 < n^2 + 9n +1 < n^2 + 10n + 25 = (n+5)^2$$

So there are only 3 cases:

$$n^2 + 9n + 1 = (n+i)^2 , i \in \{2, 3, 4\}$$

Solving each case separately, we get respectively for i = 2, 3, 4:

$$5n = 3$$ $$3n = 8$$ $$1n = 15$$

The usual way to solve these questions is as you've done: bound the expression between two consecutive perfect squares, and prove that the bounds are strict for large $n$.

The reason that one shouldn't expect a solution using modular arithmetic is that it is too "short-sighted": the question of whether a number is a perfect square or not depends on the exact multiplicity of the primes dividing it, whereas modular arithmetic only provides upper and lower bounds. This suggests that our solution must depend on a global approach.

Here is an alternative solution. We may write (completing the square):

$$\left( n + \frac{9}{2} \right)^2 - x^2 = \frac{77}{4}$$

$$(2n + 9)^2 - (2x)^2 = 77$$

$$(2n - 2x + 9)(2n + 2x + 9) = 77$$

Now, we simply check all factors of $77$ to see if they provide solutions. The given hypotheses mean that we must only check two cases: $2n + 2x + 9 = 11, 77$, and the latter gives a solution.

• I like this answer more than mine! – ypercubeᵀᴹ Oct 16 '16 at 12:33
• I made a very similar answer without knowing that someone made the same and was faster. – Peter Oct 16 '16 at 12:34
• Independent answers are fine by me. – marty cohen Oct 16 '16 at 13:06

We want to solve $$m^2=n^2+9n+1$$ over the integers.

Multiplying with $4$ gives

$$4m^2=4n^2+36n+4=(2n+9)^2-77$$

So, we have $$(2m-2n-9)\cdot (2m+2n+9)=-77$$

For every integer pair $(a,b)$ with $ab=-77$ solve the equation system

$$2m-2n-9=a$$

$$2m+2n+9=b$$

(adding the two equations shows that the solution is always unique) and verify whether $m$ and $n$ are integers and $n$ is positive.

• @starfall Didn't notice that. Shall I delete my answer ? – Peter Oct 16 '16 at 12:31
• I don't mind - it's up to you. – Starfall Oct 16 '16 at 12:34
• Only delete an answer if embarrasses you. – marty cohen Oct 16 '16 at 13:09

Solutions only for $n=0$ and $n=15$.

Clearly, $n=0$ produces a perfect square. Say now that $n>0$ and $$n^2+9n+1=k^2,$$ for some $k\ge 1$. Then $(k+1)(k-1)=n(n+9)>n(n+2)$. Thus $k-1>n$. Let $k-1=n+v$, where $v$ a positive integer. Then $$(n+v+2)(n+v)=n(n+9),$$ and hence $$n(7-2v)=v^2+2v.$$ Hence, if such $v$ exists, it can only be $v\in\{1,2,3\}$. The cases $v=1,2$ lead to contradiction. Indeed, for $v=1$, we have $5n=3$, and for $n=2$, we have $3n=8$.

Meanwhile, for $v=3$, we have $$n=15,$$ for which $n^2+9n+1=361=19^2$.