How find this $f(k)=\sum_{n=1}^{\infty}\frac{n^k}{2^n}$ is positive integers?

Question:

let $$f(k)=\sum_{n=1}^{\infty}\dfrac{n^k}{2^n},k\in N^{+}$$

show that: $f(k)$is always postive integer numbers.

this is problem is my creat it,maybe is old problem,because when I deal following $$f(1)=\sum_{n=1}^{\infty}\dfrac{n}{2^n}$$ and this solution: $$\sum_{n=1}^{\infty}nx^n=x\sum_{n=1}^{\infty}nx^{n-1}=\dfrac{x}{(1-x)^2}$$ so $$f(1)=2$$

and use same methods $$f(2)=\sum_{n=1}^{\infty}\dfrac{n^2}{2^n}=6$$ $$f(3)=\sum_{n=1}^{\infty}\dfrac{n^3}{2^n}=26$$ $$f(4)=\sum_{n=1}^{\infty}\dfrac{n^4}{2^n}=150$$ $$\cdots\cdots\cdots$$

and How prove $f(k)$ is postive integers,and maybe find the $f(k)=?$


$\newcommand{\angles}[1]{\left\langle #1 \right\rangle}% \newcommand{\braces}[1]{\left\lbrace #1 \right\rbrace}% \newcommand{\bracks}[1]{\left\lbrack #1 \right\rbrack}% \newcommand{\dd}{{\rm d}}% \newcommand{\ds}[1]{\displaystyle{#1}}% \newcommand{\equalby}[1]{{#1 \atop {= \atop \vphantom{\huge A}}}}% \newcommand{\expo}[1]{\,{\rm e}^{#1}\,}% \newcommand{\ic}{{\rm i}}% \newcommand{\imp}{\Longrightarrow}% \newcommand{\pars}[1]{\left( #1 \right)}% \newcommand{\pp}{{\cal P}}% \newcommand{\sgn}{\,{\rm sgn}}% \newcommand{\ul}[1]{\underline{#1}}% \newcommand{\verts}[1]{\left\vert #1 \right\vert}$

\begin{align} {\rm f}\pars{k} &= \sum_{n = 1}^{\infty}{n^{k} \over 2^{n}} = \sum_{n = 0}^{\infty}{\pars{n + 1}^{k} \over 2^{n + 1}} = {1 \over 2} + {1 \over 2}\sum_{n = 1}^{\infty}{1 \over 2^{n}} \sum_{\ell = 0}^{k}{k \choose \ell}n^{\ell} = {1 \over 2} + {1 \over 2}\sum_{\ell = 0}^{k}{k \choose \ell} \sum_{n = 1}^{\infty}{n^{\ell} \over 2^{n}} \\[3mm]&= {1 \over 2} + {1 \over 2}\sum_{\ell = 0}^{k}{k \choose \ell} {\rm f}\pars{\ell} = {1 \over 2} + {1 \over 2}\sum_{\ell = 0}^{k - 1}{k \choose \ell} {\rm f}\pars{\ell} + {1 \over 2}{\rm f}\pars{k} \end{align}

Then, \begin{equation} {\rm f}\pars{k} = 1 + \sum_{\ell = 0}^{k - 1}{k \choose \ell}{\rm f}\pars{\ell}\,, \quad k \geq 1\,; \qquad\qquad {\rm f}\pars{0} = 1 \tag{1} \end{equation} Since $\ds{k \choose \ell}$ in expression $\pars{1}$ is an integer, it's pretty obvious, from $\pars{1}$, that ${\rm f}\pars{k}$ is an integer.


Note that this sum is a special case of the harmonic sum $$S(x) = \sum_{n\ge 1} \frac{(xn)^k}{2^{xn}}$$ evaluated at $x=1.$

Now we can evaluate this sum by inverting its Mellin transform. We will do this evaluation, arriving at a simple closed form which is easily seen to be an integer. Recall the Mellin transform identity for harmonic sums which is $$\mathfrak{M}\left(\sum_{k\ge 1} \lambda_k g(\mu_k x);s\right) = \left(\sum_{k\ge 1} \frac{\lambda_k}{\mu_k^s} \right) g^*(s)$$ where $g^*(s)$ is the Mellin transform of $g(x).$

In the present case we have $$\lambda_k = 1, \quad \mu_k = k \quad \text{and} \quad g(x) = \frac{x^k}{2^x}.$$ We need the Mellin transform $g^*(s)$ of $g(x)$ which is $$\int_0^\infty \frac{x^k}{2^x} x^{s-1} dx = \int_0^\infty \frac{1}{2^x} x^{(s+k)-1} dx.$$ Observe that $$\int_0^\infty 2^{-x} x^{s-1} dx = \frac{1}{(\log 2)^s} \Gamma(s)$$ by a straightforward substitution that turns the integral into a gamma function integral. This implies that $$g^*(s) = \frac{1}{(\log 2)^{s+k}} \Gamma(s+k).$$ It follows that the Mellin transform $Q(s)$ of $S(x)$ is $$Q(s) = \frac{1}{(\log 2)^{s+k}} \Gamma(s+k) \zeta(s).$$ Inverting this transform we find that $$\mathrm{Res}\left(Q(s)/x^s;s=1\right) = \frac{k!}{(\log 2)^{k+1}} \frac{1}{x}.$$ For the remaining poles starting at $s=q$ where $q=-k$ we obtain the contribution $$\sum_{q=k}^\infty \mathrm{Res}\left(Q(s)/x^s;s=-q\right) = \sum_{q=k}^\infty \frac{(-1)^{q-k}}{(q-k)!} (\log 2)^{q-k} x^q \zeta(-q)\\ = - \sum_{q=k}^\infty \frac{(-1)^{q-k}}{(q-k)!} (\log 2)^{q-k} x^q \frac{B_{q+1}}{q+1} = - x^k \sum_{q=0}^\infty \frac{(-1)^q}{q!} (\log 2)^q x^q \frac{B_{q+k+1}}{q+k+1}.$$ Note that when $q$ is even in the above sum the trivial zeros of the zeta function cancel the poles of the gamma function. The sum remains correct however because the Bernoulli numbers of odd indices are zero.

Now the generating function of the Bernoulli numbers is $$\sum_{m\ge 0} B_m \frac{t^m}{m!} = \frac{t}{e^t-1},$$ which implies that $$\sum_{m\ge 1} \frac{B_m}{m} \frac{t^m}{m!} = \log(\exp(t)-1) -t -\log t$$ which implies in turn when $k\ge 1$ $$\sum_{m\ge 1} \frac{B_{m+k+1}}{m+k+1} \frac{t^m}{m!} = \left(\frac{d}{dt}\right)^{k+1} (\log(\exp(t)-1) -t -\log t) \\ = \left(\frac{d}{dt}\right)^k \left(-1 - \frac{1}{t} + \frac{e^t}{e^t-1}\right) = (-1)^{k+1} \frac{k!}{t^{k+1}} + \left(\frac{d}{dt}\right)^k \left(\frac{e^t}{e^t-1}\right).$$ Now recalling the contribution from the pole at $s=1$ of $Q(s)$ we have that $$S(1) = \sum_{n\ge 1}\frac{n^k}{2^n}\\ = \frac{k!}{(\log 2)^{k+1}} -\left((-1)^{k+1} \frac{k!}{(-\log 2)^{k+1}} + \left. \left(\frac{d}{dt}\right)^k \left(\frac{e^t}{e^t-1}\right)\right|_{t=-\log 2}\right)\\ = \frac{k!}{(\log 2)^{k+1}} - \frac{k!}{(\log 2)^{k+1}} - \left. \left(\frac{d}{dt}\right)^k \left(\frac{e^t}{e^t-1}\right)\right|_{t=-\log 2} = - \left. \left(\frac{d}{dt}\right)^k \left(\frac{e^t}{e^t-1}\right)\right|_{t=-\log 2}.$$

To see that this last expression is an integer, rewrite it as $$S(1) = - \left. \left(\frac{d}{dt}\right)^k \left(\frac{1}{1-e^{-t}}\right)\right|_{t=-\log 2}.$$ Suppose we have an expression of the form $$\frac{p(e^{-t})}{(1-e^{-t})^a}$$ with $a$ a positive integer and $p$ a polynomial with integer coefficients. Then we see that $$\frac{d}{dt} \frac{p(e^{-t})}{(1-e^{-t})^a} = p(e^{-t}) (-a) \frac{1}{(1-e^{-t})^{a+1}} e^{-t} + p'(e^{-t}) (-e^{-t}) \frac{1}{(1-e^{-t})^a}\\ = \frac{-ap(e^{-t})e^{-t}-p'(e^{-t})e^{-t}(1-e^{-t})}{(1-e^{-t})^{a+1}} = \frac{q(e^{-t})}{(1-e^{-t})^{a+1}}.$$ It is evident that the derivative has the same form as the term we were diffferentiating, being the quotient of a polynomial with integer coefficients in $e^{-t}$ and an integer power of $(1-e^{-t}).$ This holds by induction for all derivatives.

But note that $$\left.(1-e^{-t})\right|_{t=-\log 2} = -1$$ meaning that all the denominators that appear are equal to $-1$, leaving an integer contribution from the numerators, which are polynomials in $e^{-t} = 2$.

Addendum. There is a very nice combinatorial connection to this sum as a function of $k.$ The sequence obtained is $$2, 6, 26, 150, 1082, 9366, 94586, 1091670, 14174522, 204495126, 3245265146, 56183135190,$$ which has this OEIS entry.

This says that the value obtained is the number of necklaces of partitions of $n+1$ labelled beads. To prove this connection, introduce the combinatorial species $\mathcal{P}$ with specification $$\mathcal{P} = \mathfrak{C}(\mathfrak{P}_{\ge 1}(\mathcal{Z}))$$ which represents, as we see, cycles of non-empty labelled sets.

Translating to generating functions we obtain $$P(z) = \log \frac{1}{1-z} \circ (e^z-1)= \log \frac{1}{2-e^z}.$$ Hence the number of necklaces is given by (here $n\ge 0$) $$(n+1)! [z^{n+1}] \log \frac{1}{2-e^z} = (n+1)! [z^{n+1}] \left(\log \frac{1}{2} + \log \frac{1}{1-e^z/2} \right)\\ = (n+1)! [z^{n+1}] \log \frac{1}{1-e^z/2}\\ = (n+1)! [z^{n+1}] \sum_{k\ge 1} \frac{e^{zk}}{k 2^k} = (n+1)! \sum_{k\ge 1} \frac{k^{n+1}}{(n+1)!\times k\times 2^k} = \sum_{k\ge 1} \frac{k^n}{2^k}.$$ We have switched $k$ and $n$ in these remarks to bring them in line with generating function notation and the notation used in the OEIS entry. And of course the combinatorial interpretation qualifies as yet another proof that we are dealing with integers.


Consider the function $f(x)=\dfrac{1}{1-x}$. If $D=x\dfrac {d}{dx}$ then $$Df(x)=\frac{x}{(1-x)^2}$$

$$D^2f(x)=\frac{x^2+x}{(1-x)^3}$$

$$D^3f(x)=\frac{x^3+4x^2+x}{(1-x)^4}$$

By induction, one can see that $\displaystyle D^k\frac{1}{1-x}=\frac{\Phi_k(x)}{(1-x)^{k+1}}$ for a certain polynomial of degree $k$, $ \displaystyle \Phi_k(x)=\sum_{l\geqslant 1} \varphi_{k,l}x^l$. We agree that $\varphi_{n,l}=0$ if $l>n$ or $l\leqslant 0$. Note then that $$\Phi_{n+1}=x(n+1)\Phi_n+(1-x)x\Phi'_n$$ is obtained by differentiating. From this we can obtain $$\varphi_{k+1,l}=(k-l+2)\varphi_{k,l-1}+l \varphi_{k,l}$$ These are the Eulerian numbers. The Eulerian polyonomials $\Phi_{k}(x)$ are of integer coefficients. This can be proven by induction. Now, note that $\displaystyle D^k\frac{1}{1-x}=\sum_{n\geqslant 0}n^kx^n$. It follows that $\displaystyle \sum_{n\geqslant 0}\frac{n^k}{2^n}=2^{k+1}\Phi_k\left(\frac 1 2\right)$ will always be an integer.


Let $f_k(x)$ be the function $\sum_{n=0}^\infty n^kx^n$. Then $f'_k(x) = \sum_{n=1}^\infty n^{k+1} x^{n-1}$ and so $xf_k'(x) = f_{k+1}(x)$, and of course $f_0(x) = \dfrac{1}{1-x}$. Now, define $f_k(x) = \dfrac{g_k(x)}{(1-x)^{k+1}}$; then $f_k' = \dfrac{g_k'(x)}{(1-x)^{k+1}}-\dfrac{(k+1)g_k(x)}{(1-x)^{k+2}}$ so $g_{k+1}(x) = x\left((1-x)g_k'(x)-(k+1)g_k(x)\right)$. In particular, by induction we get that $g_k(x)$ is a polynomial of degree $k$ with integer coefficients. But then $f_k(\frac12) = 2^{k+1}g_k(\frac12)$ must be an integer, because $g_k(\frac12) = \frac nd$ with $d$ a power of two $\leq 2^k$.