Let $n\ge2$ be an integer and $S=${$1,\cdots,n$}. For which $\ T\subset S\ $ is $\sum_{m\in T} \frac{1}{m}$ less than $1$, but as large as possible?

50 Views Asked by At

Let $n\ge 2$ be an integer and $S=${$1,\cdots,n$}. For which subset $T$ of $S$ is the sum $$\sum_{m\in T} \frac{1}{m}$$ smaller than $1$ , but as large as possible ?

Example : $n=30$. Brute force gives $$[2,5,13,14,24,26,27,29]$$ as one of the optimal solutions with sum $1-\frac{1}{2\ 850\ 120}$

One could try to find an egyptian fraction expansion of the number $1$ such that no denominator except one exceeds the given limit and maximizing this exceptional denominator. But even if this can be done efficiently, must this be the optimum at all ?

The PARI/GP-code to find all optimal solutions is

n=30;maxi=0;forsubset(n,t,s=sum(j=1,length(t),1/t[j]);if(s<1,if(s>=maxi,maxi=s;print(Vec(t),"   ",1-s))))

Any ideas or references for this problem ?