About fractions whose sum is a natural number Some days ago I found an old problem of an olympiad that I always found interesting. It asks to replace each $\boxed{}$ with the numbers $1,2\ldots 30$ without repeating any number, such that their sum is an integer number.
$$\frac{\boxed{}}{\boxed{}}+\frac{\boxed{}}{\boxed{}}+\frac{\boxed{}}{\boxed{}}+\frac{\boxed{}}{\boxed{}}+\frac{\boxed{}}{\boxed{}}+\frac{\boxed{}}{\boxed{}}+\frac{\boxed{}}{\boxed{}}+\frac{\boxed{}}{\boxed{}}+\frac{\boxed{}}{\boxed{}}+\frac{\boxed{}}{\boxed{}}+\frac{\boxed{}}{\boxed{}}+\frac{\boxed{}}{\boxed{}}+\frac{\boxed{}}{\boxed{}}+\frac{\boxed{}}{\boxed{}}+\frac{\boxed{}}{\boxed{}}$$
I got a solution by trial-and-error and it's: $$\frac{14}{1}+\frac{23}{2}+\frac{11}{22}+\frac{19}{3}+\frac{10}{15}+\frac{29}{4}+\frac{9}{12}+\frac{17}{6}+\frac{5}{30}+\frac{25}{8}+\frac{21}{24}+\frac{16}{7}+\frac{20}{28}+\frac{27}{18}+\frac{13}{26}=53.$$
I was wondering if there is another method different than trial-and-error. Thanks in advance for your answers.

Here's what one can play around with (and supposedly, Ian Miller started similarly):
We can build as many integer fractions as possible, namely
$$\tag1\frac{30}{15}+\frac{28}{14}+ \frac{26}{13}+\frac{24}{12}+ \frac{22}{11}+  
\frac{20}{10}+ \frac{18}{9}+ \frac{16}{8},$$
each summand equalling $2$.
As $14$ is already in use, we continue with $$\tag2\frac{21}7.$$
All multiples of $6$ are used, so we postpone that for a moment and continue with
$$\tag3\frac{25}5. $$
Now we are left with $29,27,23,19,17,6,4,3,2,1$ to form five fractions. As barak manos observed, we must have the high primes $29,23,19,17$ in numerators (or otherwise, $\frac{20!}p$ times our sum would not be an integer - even if we had not started with the above strategy).
Because of what we did so far, we also cannot have $27$ in the denominator (or otherwise $12$ times our sum would not be an integer) - but that might be different if we had started differently.
Now we try to exploit that $\frac16+\frac13+\frac12$ is an integer.
We observe that $29\equiv -1\pmod 6$, $23\equiv -1\pmod 3$, and e.g. $27\equiv -1\pmod 2$, so that $$\tag4\frac{29}6+\frac{23}3 +\frac{27}2$$ is an integer.
We are now left with $19,17,4,1$, and definitely end with something having a $4$ in the denominator, namely $$\tag5\frac{19}4+\frac{17}1\quad\text{or}\quad\frac{17}4+\frac{19}1.$$
We play around with the previous fractions to mend this. For example, we can dissect our $\frac{28}{14}$ and $\frac{21}{7}$ to form $\frac 7{28}+\frac{21}{14}=\frac74$ from its parts. This adjusts our quarter-integer result to either an integer result (and we are done) or to a half-integer result. Even though we can verify that we can guarantee an integer here by making the right choice in $(5)$, it should be noted that by flipping one of the fractions in $(1)$, we could turn a half-integer sum into an integer if necessary.
