For every positive integer $k$, $\sum_{n=0}^{\infty} n^{k} p^{n} \in \mathbb{Q}$ In the final chapter of Gouvêa's "$p$-adic numbers - An Introduction", we are presented with an exercise to prove that $\sum_{n=0}^{\infty} n^{k} p^{n} \in \mathbb{Q}$. I can see that, for a fixed $p$ prime, the series will converge in $\mathbb{Q}_p$, since $\lim_{n \to \infty}|n^{k} p^{n}|_p=0$. However, I am having trouble understanding how we could prove that the sum is a rational number. I know that a rational number must eventually have a periodic $p$-adic expansion, but the problem seems too abstract to try and compute an arbitrary expansion. How should I approach this problem?
 A: Ignore $p$-adic expansions of rational numbers, and use values of $p$-adic power series right from the start.
Set $F_k(x) = \sum_{n \geq 0} n^kx^n$, a formal power series with coefficients in $\mathbf Z$.
Fix a prime $p$. Then $F_k(x)$ has coefficients in $\mathbf Z_p$ since $\mathbf Z \subset \mathbf Z_p$.  Since the coefficients of $F_k(x)$ are in $\mathbf Z_p$, $F_k$ converges on $p\mathbf Z_p$ and $F_k(p\mathbf Z_p) \subset \mathbf Z_p$. A $p$-adic power series can be differentiated termwise on an open disc where it converges, so for all $t \in p\mathbf Z_p$ we have
$$F_k'(t) = \sum_{n \geq 1} n^{k+1}t^{n-1}.$$
Thus
$$
tF_k'(t) = \sum_{n \geq 1} n^{k+1}t^{n} = 
\sum_{n \geq 0} n^{k+1}t^{n} = F_{k+1}(t).
$$
We have $F_0(t) = \sum_{n \geq 0} t^n = 1/(1-t)$, a rational function on $p\mathbf Z_p$. The derivative of a rational function is a rational function, so by induction on $k$ each $F_k(t)$ on $p\mathbf Z_p$ is a rational function. More precisely, by induction on $k$, $F_k(t)$ for all $t \in p\mathbf Z_p$ has the form $G_k(t)/(1-t)^{k+1}$ where $G_k(t) \in \mathbf Z[t]$. Finally it is time to set $t = p$: in
$\mathbf Z_p$,
$$
F_k(p) = \sum_{n \geq 0} n^kp^n = \frac{G_k(p)}{(1-p)^{k+1}}.
$$
Since $G_k$ is a polynomial with integral coefficients,
$G_k(p) \in \mathbf Z$, so $F_k(p) \in \mathbf Q$.
There was nothing essentially $p$-adic about this argument until at the end when we set $t = p$.
An analogue of it holds in $\mathbf R$:
for $|t| < 1$ in $\mathbf R$,
$F_k(t) = G_k(t)/(1-t)^{k+1}$, so
if $r \in \mathbf Q$ and $|r| < 1$ then
$F_k(r) = G_k(r)/(1-r)^{k+1} \in \mathbf Q$.
Likewise, if $|t|_p < 1$ in $\mathbf Q_p$ then $F_k(t) = G_k(t)/(1-t)^{k+1}$, so
if $r \in \mathbf Q$ and $|r|_p < 1$ then
$F_k(r) = G_k(r)/(1-r)^{k+1} \in \mathbf Q$.
Note $F_k(r)$ for $|r| < 1$ is meant to be a limit in $\mathbf R$, while $F_k(r)$ for $|r|_p < 1$ is meant to be a limit in $\mathbf Q_p$.
A: Show that $$f_{k,m(x)}:=\sum_{n=0}^m n^k x^n = \frac{p_k(x)+x^m q_{k, m}(x)}{(x-1)^{2^k}}$$
Where $p_k(x)\in\mathbb Z[x]$ is a polynomial that only depends on $k$, and $q_{k, m}\in\mathbb Z[x]$ that depends on both of $k$ and $m$.
When $k=0$, this follows from the summation of the geometric series.
In general, we do induction on $k$. We have $f_{k+1, m}=x\frac{d}{dx} f_{k, m}$, and the exact calculation is a bit messy but it's easy to convince oneself the identity indeed holds. In fact, we can even get a recursive relation to compute $p_k(x)$ if necessary.
Note that the above identity holds in $\mathbb Q$ (In fact in any ring for which $x-1$ is invertible), hence we can let $x=p$, and take the limit in $\mathbb Q_p$ on both sides as $m\rightarrow\infty$ to conclude.
