Consider two distinct positive integers $a$ and $b$ having integer arithmetic, geometric and harmonic means. Find the minimal value of $|a-b|$. Mircea Fianu
Problem
Source: Romanian JBMO TST, Day 4, Problem 18
Tags: algebra proposed, algebra
19.03.2006 02:34
Clearly $a$ and $b$ must have the same parity so let $a = k+m$ and $b = k - m$ for integers $k > m > 0$. We have $|a-b| = 2m$. Note that $ab = k^2 - m^2 = n^2$ is a perfect square. Thus, $(n,m,k)$ is a Pythagorean triple. Now, $\left( \frac{1}{2a} + \frac{1}{2b} \right)^{-1} = \left( \frac{k}{k^2-m^2} \right)^{-1} = \frac{k^2-m^2}{k}$. Thus, $k | m^2$ and $k | n^2$. Starting with a primitive Pythagorean triple $(r,s,t)$ we want $t | r^2$ and $t | s^2$ so we must scale everything by $t$ since $(r,s,t) = 1$. From this idea, we use $(20, 15, 25) = (n,m,k)$. Finally, $a = 40, b = 10$ and $|a-b| = 30$. We can check $\frac{a+b}{2} = 25$, $\sqrt{ab} = 20$, and $\frac{2ab}{a+b} = 16$!
19.03.2006 02:53
Edit: ThAzN1, your solution agrees with mine but you seem to have a slightly wrong formula for harmonic mean. $A = \frac{a+b}{2} \in \mathbb{N} \implies a \equiv b \bmod 2$ $G = \sqrt{ab} \in \mathbb{N} \implies ab = G^2$. Suppose WLOG that $a > b$. Then we can write $a = kG, b = \frac{G}{k}$ for some integer $k | G$, and hence $a = bk^2$. Furthermore, $A = \frac{b(k^2+1)}{2}$ and $G = bk$. $H = \frac{2ab}{a+b} \in \mathbb{N} \implies Hb(k^2 + 1) = 2b^2 k^2 \implies H = \frac{2bk^2}{k^2 + 1}$. Since $k^2, k^2 + 1$ share no common divisors, it follows that $(k^2 + 1) | 2b$. We know that $k \neq 1$. Now, substitute $c = k^2 - 1$. We are trying to minimize the product $|bc| = |a-b|$, and we can do this by rewriting in terms of $b$ and $c$: $A = \frac{b(c+2)}{2}$ $G = b \sqrt{c+1}$ $H = \frac{2b(c+1)}{c+2}$ We divide into two cases. Case 1: $c$ is even. Write $c = 2d$. We have the condition $2d+2 | 2b \implies b = e(d+1)$. Now, $c = 3, 8, 15, 24, ...$, so $d = 4, 12, ...$ will guarantee that $G \in \mathbb{N}$. Because $c+2 = 2(d+1)$ is even, we have guaranteed that $A \in \mathbb{N}$, and because $c+2 | 2b$ we have guaranteed that $H \in \mathbb{N}$. The minimum value here is therefore attained when $b = e(d+1) = 1(4+1) = 5$, and $bc = \boxed{40}$. Case 2: $c$ is odd. We require that $c+2 | 2b$ - hence, $b = f(c+2)$. In order that $A \in \mathbb{N}$ we require $f = 2g$, so $b = 2g(c+2)$ guarantees $A, G, H \in \mathbb{N}$. The minimum value here is therefore attained when $b = 2g(c+2) = 2(3+2) = 10$ and $bc = \boxed{30}$.
19.03.2006 03:02
OH oops yeah I'll edit it.. good thing that factor of 2 doesn't change anything
17.04.2006 03:24
A dumb solution: Let $ab=k^2$ and $a+b=2\ell$. Then $(a-b)^2 = (a+b)^2 - 4ab=4 \left( \ell^2 - k^2 \right)$, so we have to minimize $\left| \ell^2 - k^2 \right|$. Now, the dirty work: we check some cases, which will lead to the correct answer, I think.
17.08.2012 16:31
t0rajir0u wrote: $G = \sqrt{ab} \in \mathbb{N} \implies ab = G^2$. Suppose WLOG that $a > b$. Then we can write $a = kG, b = \frac{G}{k}$ for some integer $k | G$, Are you sure ? Counter example : $225 = 9 \times 25$. But, $\frac{15}{9}$ is not integer.
17.08.2012 17:46
Now, that this thread has been revived ... true! a rare occasion t0rajir0u has erred. Notice also that post #5 leads verbatim to the solution of post #2; the best shortcut, in my view. From $ab=k^2$ and $a+b=2\ell$, we need minimize $|a-b|$, or equivalently, minimize $(a-b)^2 = (a+b)^2 - 4ab = 4(\ell^2 - k^2)$. But $a,b$ are the roots of $\lambda^2 - 2\ell\lambda + k^2$, so $a,b = \ell \pm \sqrt{\ell^2 - k^2}$, whence we need $\ell^2 = k^2 + m^2$, a Pythagorean triple. This yields all instances where $\frac {a+b} {2}$ and $\sqrt{ab}$ are integer, with the minimum for $|a-b|$ equal to $6$, given for $5^2 = 4^2 + 3^2$, when $\{a,b\} = \{2,8\}$. The third condition on $\frac {2ab} {a+b} = \frac {k^2} {\ell}$ to be integer now forces $\ell \mid k^2$ and $\ell \mid m^2$, thus the minimum for $|a-b|$ equal to $30$, given for $(5\cdot 5)^2 = (5\cdot 4)^2 + (5\cdot 3)^2$, when $\{a,b\} = \{10,40\}$.
08.03.2024 20:05
Set $a=da_1$ and $b=db_1$ with $(a_1,b_1)=1$. Since $\sqrt{ab}\in\mathbb{N}$, we obtain $a_1,b_1$ are perfect squares, set $a_1=u^2$ and $b_1=v^2$. With this, $(a+b)/2\in\mathbb{N}$ implies $2\mid d(u^2+v^2)$. Furthermore, the harmonic mean of $a$ and $b$ arranges to \[ \frac{2}{\frac{1}{du^2}+\frac{1}{dv^2}} = \frac{2du^2v^2}{u^2+v^2}. \]As $(u,v)=1$, we have $(u^2v^2,u^2+v^2)=1$, yielding $u^2+v^2\mid 2d$. Now if $u^2+v^2$ is odd, then $d=2s(u^2+v^2)$ for some arbitrary $s\in\mathbb{N}$, yielding $|a-b| = 2s|u^4-v^4|$, whose smallest value (under $u,v$ being odd) is clearly obtained for $\{u,v\}=\{1,2\}$ and $s=1$, that is $d=10$ and $(a,b)=(10,40)$. The second case, namely $u^2+v^2$ being even, is handled analogously; hence the smallest value is $|a-b|=|10-40|=30$.