<s>[INST] maximum of reciprocals of integers Suppose you have n integers, such that $\sum_{i=1}^n \frac{1}{a_i}<1$. What is the maximum value of this sum?
The answers for $n=1,2,3,4$ are $1-\frac{1}{2}, 1-\frac{1}{6}, 1-\frac{1}{42}, 1-\frac{1}{42*43}$(checked by hands).
Could it be anyhow proven that this sequence is exactly connected with https://oeis.org/A007018?
 [/INST] Claim:
$\max \{ \sum_{i=1}^n \frac{1}{a_i} \} = 1- \frac{1}{A_n}$ , where $A_n=(A_{n-1})^2+A_{n-1}$ with $A_0=1$.
Proof:
Let the claim be true for some $n=k$. That is,
$\max \{ \sum_{i=1}^k \frac{1}{a_i} \} = 1- \frac{1}{A_k}$ .
Now we need to find $$\max \{ \sum_{i=1}^{k+1} \frac{1}{a_i} \} $$.
We already know
$\max \{ \sum_{i=1}^k \frac{1}{a_i} \} = 1- \frac{1}{A_k}$,
$\implies$ to get $\max \{ \sum_{i=1}^{k+1} \frac{1}{a_i} \}$, we need to find $\max \{ 1-\frac{1}{A_k} +\frac{1}{a_{k+1}} \}$ .
Notice that, if $a_{k+1} \le A_k$ then $\frac{1}{a_{k+1}} \ge \frac{1}{A_k} \implies 1 -  \frac{1}{A_k} +\frac{1}{a_{k+1}} \ge 1$, contradiction.
$\implies a_{k+1}>A_k$. For maximum, $a_{k+1}=A_k+1$
$\implies \max \{ \sum_{i=1}^{k+1} \frac{1}{a_i} \}=\max \{ 1-\frac{1}{A_k} +\frac{1}{a_{k+1}} \}=1-\frac{1}{A_k} +\frac{1}{A_k+1}=1-\frac{1}{A_k(A_k+1)}=1-\frac{1}{A_{k+1}}$.
Therefore, our claim is true by induction.
</s>