Example 2 Let $n \geqslant 2$ be a positive integer. Given pairwise distinct real numbers $a_{1}, a_{2}, \cdots, a_{n}$ forming the set $S$, define $k(S)$ as the number of distinct values of the form $a_{i}+2^{j}(i, j=1,2, \cdots, n)$. For all sets $S$, find the minimum possible value of $k(S)$.
For the set $S=\left\{a_{1}, a_{2}, \cdots, a_{n}\right\}$, define
$$
T_{i}=\left\{a_{i}+2^{j} \mid j=1,2, \cdots, n\right\}(i=1,2, \cdots, n) \text {. }
$$

Then $k(S)=\left|T_{1} \cup T_{2} \cup \cdots \cup T_{n}\right|$.
First, we prove: For any $i \neq j$, we have
$$
\left|T_{i} \cap T_{j}\right| \leqslant 1 \text {. }
$$

In fact, if $\left|T_{i} \cap T_{j}\right| \geqslant 2$, then there exist positive integers $p, q, r, s$ not greater than $n$, such that
$$
a_{i}+2^{p}=a_{j}+2^{q}, a_{i}+2^{r}=a_{j}+2^{s} .
$$

Without loss of generality, assume $a_{i}>a_{j}$ and $p<r$.
Then $p<q, r<s$.
Thus, $a_{i}-a_{j}=2^{q}-2^{p}=2^{s}-2^{r}$.
Rearranging gives $2^{q-p}-1=2^{r-p}\left(2^{s-r}-1\right)$.
The left side of the above equation is odd, while the right side is even, leading to a contradiction.
Hence, $\left|T_{i} \cap T_{j}\right| \leqslant 1$.
By the principle of inclusion-exclusion, we have
$$
\begin{array}{l}
k(S)=\left|T_{1} \cup T_{2} \cup \cdots \cup T_{n}\right| \\
\geqslant \sum_{i=1}^{n}\left|T_{i}\right|-\sum_{1 \leqslant i<j \leqslant n}\left|T_{i} \cap T_{j}\right| \\
\geqslant n^{2}-\mathrm{C}_{n}^{2} \cdot 1=\frac{n(n+1)}{2} .
\end{array}
$$

Next, take $S=\left\{2,2^{2}, \cdots, 2^{n}\right\}$.
Then the set of all numbers of the form $a_{i}+2^{j}(i, j=1,2, \cdots, n)$ is
$$
\begin{array}{l}
M=\left\{a_{i}+2^{j} \mid a_{i} \in S, j=1,2, \cdots, n\right\} \\
=\left\{2^{i}+2^{j} \mid i, j=1,2, \cdots, n\right\} \\
=\left\{2^{i}+2^{j} \mid 1 \leqslant i \leqslant j \leqslant n, i, j \in \mathbf{Z}_{+}\right\} .
\end{array}
$$

Clearly, $|M|=\frac{n(n+1)}{2}$, i.e.,
$$
k(S)=\frac{n(n+1)}{2} .
$$

In summary, the minimum value of $k(S)$ is $\frac{n(n+1)}{2}$.