When is $\sum_{n=0}^{\infty}\frac{n^k}{3^n}$ an integer?

The problems boils down to a rather simple question about Bernoulli numbers. We have:

$$ \sum_{n\geq 0}\frac{e^{nx}}{b^n} = \frac{b}{b-e^{x}}\tag{1} $$ hence: $$ \sum_{n\geq 0}\frac{n^k}{b^n} = \frac{d^k}{dx^k}\left.\,\frac{b}{b-e^{x}}\right|_{x=0}=\frac{Q_k(b)}{(b-1)^{k+1}}\tag{2}$$ with $Q_k$ being a polynomial of degree $k$ with integer coefficients.

In order to understand when the LHS of $(2)$ has some chance to be an integer, it is enough to recall the generating function for the Bernoulli numbers and the Von-Staudt-Clausen theorem.


I tested whether $f(k) = \sum_{k=0}^\infty n^k \,3^{-n}$ is an integer for $k = 0$ to $50000$. In this range, $f(k) \in \mathbb{Z}$ if and only if $k$ has one of the following forms (for $j \ge 0$):

  • $4+4j$ (* with exceptions—see below)
  • $13+64j$
  • $122+256j$
  • $379+1024j$
  • $1529+2048j$
  • $8181+32768j$

There are two sequences of exceptions to the first case (i.e., when $k$ is a positive multiple of $4$). When $k$ has either of the forms

  • $28+32j$
  • $1016+1024j$

then $f(k) \notin \mathbb{Z}$.

How does this extend to all $k$? A natural conjecture is that there is an infinite list of sequences like the ones above, as well as an infinite list of exception sequences to the multiple-of-$4$ case. We would expect that they all have of a power-of-$2$ stride and that they begin at an integer smaller than their stride (except for the first sequence).