*Posted by Alex in : potd , trackback
*
A positive integer is *LPofXaak* if there exists a way to form two positive integers using its digits (for example, the pair $(8, 97)$ can be formed from $789$ and the pair $(01, 2)$ can be formed from $210$) such that the arithmetic mean of these two integers is equal to the geometric mean of the sum of the two integers and the positive difference of the two integers. Leading zeroes of numbers do not count as digits, and the numbers formed cannot contain leading zeroes. Let $Q$ be the sum of all *LPofXaak* numbers less than $1000$. Find the remainder when $Q$ is divided by $1000$.

show

**Solution:**
Let $a$ and $b$ be the two integers formed from the digits of a *LPofXaak* number. Based on the described relationship, $$\frac{a + b}{2} = \sqrt{(a + b)(a – b)}$$ Squaring both sides of the equation and then simplifying gives $$3a^2 -2ab – 5b^2 = 0$$ which factors to give $$(3a – 5b)(a + b) = 0$$ The solutions are $b = -a$ and $b = \frac{3}{5}a$. Since $a$ and $b$ are both positive, the first solution is irrelevant. The second solution tells us that all *LPofXaak* have digits that can be arranged to form one number that is $\frac{3}{5}$ of another. Because we are only looking for *LPofXaak* numbers under $1000$, one of the two numbers must be a single digit number. The other number, which is larger, must be $\frac{5}{3}$ of this number, so the single digit must be a multiple of three. The only possible pairs are $(3, 5)$, $(6, 10)$, and $(9, 15)$. All possible rearrangements give

$$\begin {eqnarray}Q &=& 35 + 53 + 106 + 160 + 601 + 610\\ & & + 159 + 195 + 519 + 591 + 915 + 951 = 4895\end {eqnarray} $$

Thus, the answer is $\boxed{895}$.

## Comments»

wait i thought leading zeros couldn’t be used to form numbers. so how does a number like 350 work?

Oops. I need to make that clearer. Thanks Billy.

My original intention with that statement was: you can’t choose 16 and then make 10 and 6 by using the zero in front of the 16. I like your interpretation more, though.