# 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$.
{"ft_lang_label":"__label__en","ft_lang_prob":0.94661033,"math_prob":0.99997854,"size":958,"snap":"2019-43-2019-47","text_gpt3_token_len":275,"char_repetition_ratio":0.094339624,"word_repetition_ratio":0.0,"special_character_ratio":0.31002086,"punctuation_ratio":0.11374407,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.9999956,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2019-11-14T08:32:34Z\",\"WARC-Record-ID\":\"<urn:uuid:d18588d4-d563-4980-9373-72c23f1522e0>\",\"Content-Length\":\"166955\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:aad1ab38-2916-4676-9b09-600b9d4cca8f>\",\"WARC-Concurrent-To\":\"<urn:uuid:aba8c5ee-fd17-4cb2-a9a9-eb7c3c19a84d>\",\"WARC-IP-Address\":\"151.101.65.69\",\"WARC-Target-URI\":\"https://math.stackexchange.com/questions/1970903/find-all-positive-solutions-such-that-n2-9n-1-is-a-perfect-square\",\"WARC-Payload-Digest\":\"sha1:YDQCHR37MMMDAZXS7WWH37WQZZDHSMZB\",\"WARC-Block-Digest\":\"sha1:SSZGQJCAQF3LI6P2ZPFQJXWIV5VV5UYJ\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2019/CC-MAIN-2019-47/CC-MAIN-2019-47_segments_1573496668334.27_warc_CC-MAIN-20191114081021-20191114105021-00381.warc.gz\"}"}