4. Let the natural number $n \geqslant 5, n$ different natural numbers $a_{1}, a_{2}, \cdots$, $a_{n}$ have the following property: for any two different non-empty subsets $A, B$ of the set $S=\left\{a_{1}, a_{2}, \cdots, a_{n}\right\}$, the sum of the numbers in $A$ and the sum of the numbers in $B$ will not be equal. Under the above conditions, find
$$
\frac{1}{a_{1}}+\frac{1}{a_{2}}+\cdots+\frac{1}{a_{n}}
$$

the maximum value.
4. Let's assume $a_{1}c_{2}>\cdots >c_{n}$, and $D_{k}=\sum_{i=1}^{t} a_{i}-\left(1+2+\cdots+2^{k-1}\right)=\sum_{i=1}^{k} a_{i}-\left(2^{k}-1\right) \geqslant 0$. Then,
$$
\begin{array}{l} 
1+\frac{1}{2}+\cdots+\frac{1}{2^{n-1}}-\left(\frac{1}{a_{1}}+\cdots+\frac{1}{a_{n}}\right)=\sum_{i=1}^{n} c_{i} d_{i} \\
= c_{1} D_{1}+c_{2}\left(D_{2}-D_{1}\right)+\cdots+c_{n}\left(D_{n}-D_{n-1}\right) \\
=\left(c_{1}-c_{2}\right) D_{1}+\left(c_{2}-c_{3}\right) D_{2}+\cdots+\left(c_{n-1}-c_{n}\right) D_{n-1}+ \\
c_{n} D_{n} \geqslant 0,
\end{array}
$$

This proves that
$$
\frac{1}{a_{1}}+\frac{1}{a_{2}}+\cdots+\frac{1}{a_{n}} \leqslant 1+\frac{1}{2}+\cdots+\frac{1}{2^{n-1}}=2-\frac{1}{2^{n-1}}.
$$

It is easy to verify that the set $S=\left\{1,2,2^{2}, \cdots, 2^{n-1}\right\}$ satisfies the given conditions, and $1+\frac{1}{2}+\frac{1}{2^{2}}+\cdots+\frac{1}{2^{n-1}}=2-\frac{1}{2^{n-1}}$.
In conclusion, the maximum value sought is $2-\frac{1}{2^{n-1}}$.
(First Test Proposers: Li Dayuan, Liu Jikun, Yu Yinglong, Ye Shengyang, Xu Sanbao; Second Test Proposers: Jie Wuchang, Huang Xuan, Xiong Shi)