For the general case,
you will encounter the
Stirling numbers
of the second kind.
In this case,
you are given
$f(z)=\sum_{n=0}^{\infty} a_nz^n$
and want to find
$f_k(z)
=\sum_{n=0}^{\infty} n^ka_nz^n
$.
By repeated differentiation,
$f^{(k)}(z)=\sum_{n=k}^{\infty} (n)_k a_nz^{n-k}$
where
$(n)_k
=n(n-1)...(n-k+1)
$
is the Pochhammer symbol
denoting the falling factorial.
Therefore
$\sum_{n=0}^{\infty} (n)_k a_nz^{n}
=z^kf^{(k)}(z)
$.
We now use the definition
of the Stirling numbers
of the second kind:
$\sum_{j=0}^k S(k, j) (n)_j
=n^k
$.
Note: The Stirling numbers of the first kind
go the other way,
expressing
$(n)_k
=\sum_{j=0}^k s(k, j) n^j
$
These make is easy to get a formula
for $f_k(z)$:
$\begin{align}
f_k(z)
&=\sum_{n=0}^{\infty} n^ka_nz^n\\
&=\sum_{n=0}^{\infty} a_nz^n\sum_{j=0}^k S(k, j) (n)_j\\
&=\sum_{j=0}^k\sum_{n=0}^{\infty} a_nz^n S(k, j) (n)_j\\
&=\sum_{j=0}^k S(k, j) \sum_{n=0}^{\infty} a_nz^n (n)_j\\
&=\sum_{j=0}^k S(k, j) z^k f^{(k)}(z)\\
\end{align}
$
For $k=3$,
$S(3, 1..3) = [1, 3, 1]$,
so
$\sum_{n=0}^{\infty} n^3a_nz^n
=z^3 f'''(z)+3z^2f''(z)+zf'(z)
$.
For $k=4$,
$S(4, 1..4) = [1, 7, 6, 1]$,
so
$\sum_{n=0}^{\infty} n^4a_nz^n
=z^4 f^{(4)}(z)+7z^3 f'''(z)+6z^2f''(z)+zf'(z)
$.