What is the result of the following binomial sum? When computing the expectation of $S_n^{-1}I_{[S_n > 0]}$ with $S_n \sim \text{binomial}(n, p)$, I need to evaluate the sum:

\begin{align*}
\sum_{k = 1}^n \frac{1}{k}\binom{n}{k}p^{k}(1 - p)^{n - k}
\end{align*}
  for $p \in (0, 1)$. 

Is there any well-known binomial identity that can be directly applied to get the above sum? Or any other methods?
My attempt:
Denote $\sum_{k = 1}^{n - 1} \frac{1}{k}\binom{n}{k}p^{k}(1 - p)^{n - k}$ by $f(p), p \in (0, 1)$. Differentiating once with respect to $p$, we get
\begin{align*}
f'(p) =  - \frac{n}{1 - p}f(p) + \frac{1}{p(1 - p)}(1 - p^n - (1 - p)^n)
\end{align*}
This nonhomogeneous linear ODE seems solvable but could be tedious...

Here is a transformation which simplifies the sum somewhat by extracting Harmonic numbers $H_n=1+\frac{1}{2}+\cdots+\frac{1}{n}$.

We obtain for $n\geq 1$
  \begin{align*}
\color{blue}{f_n}&\color{blue}{=\sum_{k = 1}^n \frac{1}{k}\binom{n}{k}p^{k}(1 - p)^{n - k}}\\
&=\sum_{k = 1}^n \frac{1}{k}\left(\binom{n-1}{k}+\binom{n-1}{k-1}\right)p^{k}(1 - p)^{n - k}\\
&=\sum_{k = 1}^n \frac{1}{k}\binom{n-1}{k}p^{k}(1 - p)^{n - k}
+\frac{1}{n}\sum_{k = 1}^n \binom{n}{k}p^{k}(1 - p)^{n - k}\\
&=(1-p)f_{n-1}+\frac{1}{n}\left((p+(1-p))^n-(1-p)^n\right)\\
&\color{blue}{=(1-p)f_{n-1}+\frac{1}{n}-(1-p)^n\frac{1}{n}}\\
\end{align*}

Iterating this recurrence relation we get with $f_1=p$

\begin{align*}
\color{blue}{f_n}&=(1-p)f_{n-1}+\frac{1}{n}-(1-p)^n\frac{1}{n}\\
&=(1-p)^2f_{n-2}+(1-p)\frac{1}{n-1}+\frac{1}{n}-(1-p)^n\left(\frac{1}{n-1}+\frac{1}{n}\right)\\
&=(1-p)^3f_{n-3}+(1-p)^2\frac{1}{n-2}+(1-p)\frac{1}{n-1}+\frac{1}{n}\\
&\qquad-(1-p)^n\left(\frac{1}{n-2}+\frac{1}{n-1}+\frac{1}{n}\right)\\
&=\cdots\\
&=(1-p)^{n-1}f_1+\sum_{k=0}^{n-2}(1-p)^k\frac{1}{n-k}-(1-p)^n\left(H_n-1\right)\\
&=(1-p)^{n}\left(\frac{p}{1-p}+1-H_n\right)+\sum_{k=0}^{n-2}(1-p)^{n-k-2}\frac{1}{k+2}\tag{1}\\
&\color{blue}{=(1-p)^{n}\left(-H_n+\sum_{k=1}^{n}(1-p)^{-k}\frac{1}{k}\right)}\tag{2}\\
\end{align*}

Comment:


*

*In (1) we  change the order of summation $k\rightarrow n-2-k$, use $f_1=p$ and do some simplifications.

*In (2) we do some simplifications, shift the index and start with $k=1$.
