0

I want to know a general efficient solution for determining whether there are solutions for $x$ in the equation

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

for $n\le 11$. I tried solving for $n$ as a quadratic equation but didn't really learn anything from that.

$$ n = \frac{9-x\pm \sqrt{(9-x)^2 -4(-2-11x)}}{2} $$

Obviously I could brute-force search all choices of $n$, and did, and found that $n=9$ yields an integer solution. But I feel like I must be missing the point of the problem if I had to brute-force search it.

This occurs in the context of learning the Euclidean algorithm for finding the GCD and some concepts of modular arithmetic. I thought about computing both sides of the equation mod 12, but I don't see anything helpful from that.

I also thought about ways to factor the square, but completing the square either involves getting a fraction or is just equivalent to the quadratic equation, so that doesn't seem productive.

lone student
  • 14,709
Addem
  • 5,656
  • You have a quadratic Diophantine equation with unknowns $x$ and $n$. It boils down to a few methods, which should be found in a book on elementary number theory I guess. – mvw Jun 24 '21 at 23:05
  • $n+2\mid f(n)\iff n+2 \mid f(-2),$ by $,f(n)\equiv f(-2)\pmod{n+2},,$ for amy poly $f(x)$ with integer coef's, see the linked dupe. – Bill Dubuque Jun 25 '21 at 20:37

3 Answers3

3

Don't try the quadratic equation. Check out the first hint and try to solve the problem. If it doesn't work, check the second hint.

Hint 1:

Rearrange: $n^2+11n-2n-2=n(n+11)-2n-2=(n+11)x$

Hint 2:

Divide by $n+11$ and note that both sides should be integer: $$n - \frac{2n+2}{n+11} = x$$ What can we say about $n$ ? What possible values can $n$ have for $\frac{2n+2}{n+11}$ to be an integer?

I hope these are enough to help you solve the problem. Let me know if you need the third hint.

Edit - the rest of the solution:

$$\frac{2n+2}{n+11} = \frac{2n+22-20}{n+11} = 2 - \frac{20}{n+11}$$ the value of $n$ should make $\frac{20}{n+11}$ an integer. So $n+11$ should be a divisor of $20$. Now, since $0 \le n \le 11$ we have $11 \le n+11 \le 22$ . This means the only possible divisor of $20$ that $n+11$ can be is $20$. Therefore $n=9$ , and going back to the second hint we find that $x=8$.

Saeed
  • 1,872
  • Do you just search the numbers 0 through 11 to find one which makes $(2n+2)/(n+11)$ an integer? So the method here isn't so much a solution method, but rather it simplifies the calculations that must be done in the brute-force search? – Addem Jun 25 '21 at 04:19
  • @Addem there is no need for a brute-force search in this case. I will add the calculations in the answer. – Saeed Jun 25 '21 at 04:58
  • Please strive not to add more dupe answers to dupes of FAQs, cf. recent site policy announcement here. – Bill Dubuque Jun 25 '21 at 20:38
  • @BillDubuque Can you please clarify what you mean? I just followed your link and read the announcement and still don't understand your comment. Are you claiming my work is duplicate and not original? Or do you consider my answer to be of low quality? If so, I'll appreciate to learn about my weaknesses. – Saeed Jun 25 '21 at 20:54
  • You shouldn't answer questions that are dupes of FAQs. – Bill Dubuque Jun 25 '21 at 20:56
  • @BillDubuque I just noticed the question is marked as a duplicate. If you were referring to the question, I understand your point and I will not answer questions that I see are marked as duplicate. As an individual user, I myself have raised the duplicate flag too. I respect that regulation. Please note that when I posted my answer, it was not flagged as duplicate and I did not know it was asked before. – Saeed Jun 25 '21 at 21:01
  • Please search for dupes or wait for someone to do so - esp. for simple common questions like this which have obviously been anywered tens if not hundreds of times over the past 10 years). – Bill Dubuque Jun 25 '21 at 21:05
3

$$\begin{align}x=\frac{n^2+11n-2n-2}{n+11} &=n- \frac{2n+2}{n+11}\\ &=n-\frac{2n+22-20}{n+11}\\ &=n-2-\frac{20}{n+11} \\ &\implies n+11=20, ~ 0≤n≤11\\ &\implies n=9.\end{align}$$

lone student
  • 14,709
0

Let $n=m-11$ (with $11\le m\le22$), so that

$$n^2+9n-2=(m-11)^2+9(m-11)-2=m^2-13m+20$$

and thus solving $m^2-13m+20=mx$ for $x$ gives

$$x=m-13+{20\over m}$$

The only divisor of $20$ in the range $11\le m\le22$ is $m=20$, corresponding to $n=9$.

Barry Cipra
  • 79,832