Find all positive integers $a,b$ such that $\frac{a^2+b}{b^2-a}$ and $\frac{b^2+a}{a^2-b}$ are also integers.
Problem
Source: IMOTC 2015 Practice Test 1 Problem 1
Tags: number theory, APMO
11.07.2015 14:52
An old problem. See here http://artofproblemsolving.com/community/c146h150477p849366
18.02.2017 14:01
Also is 2002 APMO #2
17.08.2020 20:31
The following must hold $a(a+1) \ge b(b-1)$ and $b(b+1) \ge a(a-1)$ If the equality doesn't hold, It is easy to see that $a=b$, Suppose the equality holds, then $a=b-1.$ Doing casework in both cases, We see the only solutions are$(2,2),(3,3),(1,2),(2,1),(2,3),(3,2)$
14.11.2023 10:01
WLOG, let $a\geq b$. Clearly, $a^2-b>0$ and so we require \[b^2+a \geq a^2-b \implies b(b+1)\geq a(a-1)\]But, note that if $a\geq b+2$ we have that \[a(a-1) \geq (b+2)(b+1)>b(b+1)\]So, $a=b$ or $a=b+1$. Now, if $a=b$ we have that \[b^2-b \mid b^2+b \implies b^2-b \mid 2b\]and thus, $b^2\leq 3b$ which is true if and only if $b\leq 3$. Checking the cases $b=1,2,3$ we see that $b=2,3$ indeed generate solutions. If $a=b+1$ then, \[b^2-b-1 \mid b^2+3b+1 \implies b^2-b-1 \mid 4b+2\]so we must have $b^2\leq 5b+3$ which is true if and only if $b\leq 5$. Checking the cases $b=1,2,3,4,5$ we see that the first fraction is an integer only in the cases $b=1,2$. Thus, the pairs of positive integers $(a,b)$ such that both $\frac{a^2+b}{b^2-a}$ and $\frac{b^2+a}{a^2-b}$ are also integers are $\boxed{(2,2),(3,3),(3,2),(2,3),(2,1),(1,2)}$ and we are done.