Find all positive integers $a$ and $b$ such that \[ {a^2+b\over b^2-a}\quad\mbox{and}\quad{b^2+a\over a^2-b} \] are both integers.
Problem
Source: APMO 2002
Tags: number theory
08.04.2006 17:15
WLOG,suppose $a\geqslant b$. If $a=b$,$\frac{a^2+a}{a^2-a}=\frac{a+1}{a-1}=1+\frac{2}{a-1}\in Z$ $a-1|2,a-1=1,2 a=2,3$ If $a>b$, $(a^2-b)-(b^2+a)=(a-b-1)(a+b)\geqslant0$ (1)$a-b>1$,$a^2-b>b^2+a>0,0<\frac{b^2+a}{a^2-b}<1$,a contradiction. (2)$a-b=1$,$a^2-b=b^2+a$ $\frac{a^2+b}{b^2-a}=\frac{b^2+3b+1}{b^2-b-1}=1+\frac{2(2b+1)}{b^2-b-1}$ $b^2-b-1|2(2b+1)$,and $b^2-b-1$ is odd,$b^2-b-1|2b+1$ $b^2-b-1\leq 2b+1,b^2-3b-2\leq0,b\leq3$,and $b>0$ easy to know $b=1,2$ So $(a,b)=(2,2)(3,3)(1,2)(2,1)(2,3)(3,2)$
20.05.2010 20:38
barcelona wrote: From $ \frac{a^{2}+b}{b^{2}-a} $,we get:$a^2+b\geb^2-a => b^2-b-a^2-a\le0$ $D=1+4a^2+4a=(2a+1)^2$ which means that :$b\in[1;a+1]$ From $\frac{b^{2}+a}{a^{2}-b} $,we get that $b^2+a\gea^2-b => b^2+b+a-a^2\ge0$ $D=1-4a+4a^2=(2a-1)^2$ which means that $b\in[a-1;\infty ]$. So finaly we get $b\in[a-1;a+1]$ 1case: $b=a-1$.Here we get the solutions $(a,b)=\{(2,1),(3,2)\}$ 2case: $a=b$..Here we get the solutions $(a,b)=\{(2,2),(3,3)\}$ 3case: $b=a+1$..Here we get the solutions $(a,b)=\{(3,2),(3,4)\}$ ophiophagous wrote: WLOG $a \ge b$ $b^2 + a \ge a^2 - b$ $a^2 - b^2 = (a+b)(a-b) \le a+b$ $a-b \le 1$ and the rest follows
13.03.2013 16:55
barcelona wrote: $b=a+1$..Here we get the solutions $(a,b)=\{(3,2),(3,4)\}$ $(3, 4)$ is not a solution!
27.02.2015 18:26
What's wrong with this solution?
EDIT: Oops I forgot to account for the fact that the given expressions didn't necessarily have to be positive. I get it now
05.09.2015 17:19
Here's another solution: Let first WLOG be $a \ge b$. Because of $a^{2} - b | b^{2} + a$ we have that $a^{2} - b \le b^{2} + a$ so $a^{2} - a \le b^{2} + b \le b^{2} + a$, or equivalently $a^{2} - 2a \le b^{2}$ so either $a^{2} - 2a = b^{2}$ or $(a-1)^{2} \le b^{2} \le a^{2} $ So we have three cases: $1) a = b$ which implies $a^{2} - a | a^{2} + a$ and also $a^{2} - a | 2a$ so $a \le 3$ which gives the solutions $(2,2)$ and $(3,3)$. $2) b = a - 1$ which implies $a^{2} - 3a + 1 | a^{2} + a - 1$ so $a^{2} - 3a + 1 | 4a - 2$ so $1 \le a \le 6$, and checking these values gives the solutions $(2,1)$, $(3,2)$ and also $(1,2)$ and $(2,3)$ by symmetry. $3) b^{2} = a^{2} - 2a$ or $(b - a +1)*(b + a - 1) = -1$, but this equation has no solutions in natural numbers so we are done.
17.12.2016 19:51
Here's a proof sketch that's similar to steppewolf's: Use division bounds to get three cases: a=b+1, b=a+1 and a=b. First two cases are symmetric, so all solutions can be derived from the second and third cases alone. Case 3: a=b. Both expressions simplify to $\frac{a+1}{a-1}$, whose gcd must be either 1 or 2 by the euclidean alg. The former yields (2,2) and the latter yields (3,3). Case 2: b=a+1. One of the expressions simplifies to 1, so ignore that. The other simplifies to $\frac{a^2+3a+1}{a^2-a-1} = 1+\frac{4a+2}{a^2-a-1}$. Use division bounds again to get that a=1,2,3,4. From this, just plug in until you get solutions of (2,1), (1,2), (2,3), (3,2). And you're done.
04.06.2017 17:48
Since $a^2+b$ and $b^2+a$ are more than zero, we have $a^2+b\geq b^2-a$, and $b^2+a \geq a^2-b$. These cases reduce to $a \geq b-1$ and $b+1 \geq a$ respectively, so we see that $b+1 \geq a \geq b-1$. We now have three cases, $a=b-1$, $a=b$ and $a=b+1$ of which the latter case is the mirror of the first, so we essentially have two cases. Case One: $a=b-1$ We see that the fractions reduce to $1$ and $\frac{b^2+b-1}{b^2-3b+1}$. Since $b^2+b-1 \geq b^2-3b+1$, we see that $4b-2 \geq b^2-3b+1$, yielding that $b \leq 6$. Now, we must simply check $b \in (1,2,3,4,5,6)$. It is easy to see through testing that the only two solution here are $(1,2)$ and $(2,3)$. Case Two: $a=b$ We see that $\frac{b^2+b}{b^2-b}$ must be an integer, so $2b \geq b^2-b$, yielding $b \in (1,2,3)$, from which we see that $(2,2)$ and $(3,3)$ are solutions. Hence, the only solution are $(1,2)$, $(2,3)$, $(2,1)$, $(3,2)$, $(2,2)$ and $(3,3)$ are the only solutions. $\square$
06.02.2020 14:35
Because $ b^2 - a | a^2 + b $ so we have $ b^2 - a \le a^2 + b $ and then $ b \le a + 1 $ which means $ b = a + 1 $ or $ b = a $ so we can easily work it out
30.05.2020 23:58
We know that: $$a^2+b \ge b^2-a \Longleftrightarrow a^2+a \ge b^2 -b \Longleftrightarrow \left(a + \frac{1}{2} \right)^2 \ge \left(b - \frac{1}{2} \right)^2 \Longleftrightarrow a + \frac{1}{2} \ge b - \frac{1}{2} \Longleftrightarrow a -b \ge -1$$$$b^2 + a \ge a^2 -b \Longleftrightarrow b^2 + b \ge a^2 -a \Longleftrightarrow \left(b + \frac{1}{2} \right)^2 \ge \left(a - \frac{1}{2} \right)^2 \Longleftrightarrow b + \frac{1}{2} \ge a- \frac{1}{2} \Longleftrightarrow a-b \le 1$$Case 1: $a = b + 1$ $$\frac{a^2+b}{b^2 -a} = \frac{b^2 + 3b + 1}{b^2 - b - 1} = 1 + \frac{4b + 2}{b^2-b-1}$$Note that when $b \ge 7$, $4b + 2 < b^2 -b -1$, so all we have to do is manually check all $b$ from $0$ to $6$, which gives solutions: $(a, b) = \boxed{(1, 2), (2, 3)}.$ Case 2: $a = b $ $$\frac{a^2+b}{b^2-a}=\frac{a^2+a}{a^2-a} = \frac{a+1}{a-1} = 1 + \frac{2}{a-1}$$This gives solutions $(a , b ) = \boxed{(2,2),(3,3)}$ Case 3: $b = a + 1$ $$\frac{b^2+a}{a^2-b} = \frac{a^2+3a+1}{a^2-a-1} = 1 + \frac{4a+2}{a^2-a-1}$$which by the same reasoning as Case 1, gives $(a , b) = \boxed{(2,1),(3,2)}$.
11.09.2020 19:50
AopsUser101 wrote: We know that: $$a^2+b \ge b^2-a \Longleftrightarrow a^2+a \ge b^2 -b \Longleftrightarrow \left(a + \frac{1}{2} \right)^2 \ge \left(b - \frac{1}{2} \right)^2 \Longleftrightarrow a + \frac{1}{2} \ge b - \frac{1}{2} \Longleftrightarrow a -b \ge -1$$$$b^2 + a \ge a^2 -b \Longleftrightarrow b^2 + b \ge a^2 -a \Longleftrightarrow \left(b + \frac{1}{2} \right)^2 \ge \left(a - \frac{1}{2} \right)^2 \Longleftrightarrow b + \frac{1}{2} \ge a- \frac{1}{2} \Longleftrightarrow a-b \le 1$$Case 1: $a = b + 1$ $$\frac{a^2+b}{b^2 -a} = \frac{b^2 + 3b + 1}{b^2 - b - 1} = 1 + \frac{4b + 2}{b^2-b-1}$$Note that when $b \ge 7$, $4b + 2 < b^2 -b -1$, so all we have to do is manually check all $b$ from $0$ to $6$, which gives solutions: $(a, b) = \boxed{(1, 2), (2, 3)}.$ Case 2: $a = b $ $$\frac{a^2+b}{b^2-a}=\frac{a^2+a}{a^2-a} = \frac{a+1}{a-1} = 1 + \frac{2}{a-1}$$This gives solutions $(a , b ) = \boxed{(2,2),(3,3)}$ Case 3: $b = a + 1$ $$\frac{b^2+a}{a^2-b} = \frac{a^2+3a+1}{a^2-a-1} = 1 + \frac{4a+2}{a^2-a-1}$$which by the same reasoning as Case 1, gives $(a , b) = \boxed{(2,1),(3,2)}$. Hey! I believe you forgot to account for $a=b$ since the inequalities are satisfied there as well. In my opinion the problem is basically trivialised once we consider inequalites since first one gives $b-a \leq 1$ and second one gives $a-b \leq 1$ so it is clear that we can only have $b=a+1$ or $b=a$ ( I am writing for $b$ only since it doesn't matter as the equations are symmetric). And then the equality case is clearly super easy while the other one gives an upper bound of $a \leq 5$ which is simple case analysis. Simple problem . Sincerely, Aayam
21.09.2020 15:00
Observe equation is symmetric so $(a, b) =(b, a)$ $a^2+b\geq b^2-a$ gives $a-b\geq -1$ and $b^2+a\geq a^2-b$ gives $a-b\leq 1$ Hence $-1\leq a-b \leq 1$ Case 1-: when $a-b=0$ we get $\frac{a+1}{a-1}\in N$ $\implies a=2, a=3$ Case 2-: when $a=b+1$ we get $\frac{b^2+3b+1}{b^2-b-1} \in N$ $\implies b=2, a=1$ Case 3 -: when $a=b-1$ we get $\frac{b^2+b-1}{b^2-3b-1} \in N$ $\implies b=3, a=2$
16.02.2022 20:11
Maths_1729 wrote: Observe equation is symmetric so $(a, b) =(b, a)$ $a^2+b\geq b^2-a$ gives $a-b\geq -1$ and $b^2+a\geq a^2-b$ gives $a-b\leq 1$ Hence $-1\leq a-b \leq 1$ Case 1-: when $a-b=0$ we get $\frac{a+1}{a-1}\in N$ $\implies a=2, a=3$ Case 2-: when $a=b+1$ we get $\frac{b^2+3b+1}{b^2-b-1} \in N$ $\implies b=2, a=1$ Case 3 -: when $a=b-1$ we get $\frac{b^2+b-1}{b^2-3b-1} \in N$ $\implies b=3, a=2$ nice one