Find two numbers whose sum is 20 and LCM is 24 With some guess work I found the answers to be 8 and 12.
But is there any general formula for this?
Note that the question is asked to my nephew who is at 4th grade.

Let $x$ and $y$ be the numbers. Note that $xy$ is the product of the LMC and the gcd, say, $d$. Then:
$$xy=24d$$
$$x+y=20$$
I don't know if at 4th grade the pupils are supposed to be able of solve systems. If it is the case, you can write
$$y=20-x$$
and then
$$x(20-x)=24d$$
Solve $x$ to get
$$x=\frac{20\pm\sqrt{400-96d}}2=10\pm2\sqrt{25-6d}$$
Therefore, $25-6d$ must be a perfect square. This only happens if $d=4$, which yields $x=8$ or $x=12$.
This is not a formula, but it makes the search much easier.
