Generating function of a Fractional Part

I'd like to compute the following generating function \begin{align} g_{a,b}(x) = \sum_{k \geq 0} \lbrace \tfrac{a k}{b} \rbrace z^{k} \end{align} where $\frac{a}{b} \in \mathbb{Q}$ and $\lbrace \cdot \rbrace$ denotes the fractional part function. I can compute the aforementioned generating function for a few special cases. I believe the general case should be of the form \begin{align} g_{a,b}(t) = \frac{P(z)}{1-z^{b}}. \end{align} where $P$ is a $\mathbb{Z}$-polynomial with degree no greater than $b-1$. The $b$-periodicity of the fractional part above should play an essential role. Any help or hints in computing the general case is appreciated.

Thanks!

Update: After a little more work, I compute $P(z) = \sum_{k = 0}^{b-1} \lbrace \frac{a k}{b} \rbrace z^{k}$.

-
I think you have the solved problem, but I would like to know what use having this "generating function" is? –  quanta May 16 '11 at 1:40
It's related to computing lattice points for $t$-dilates of the interval $[0,a/b]$. –  user02138 May 16 '11 at 2:02

$\frac{P(z)}{1 - z^b}$ is nothing more than $P(z) + z^b P(z) + z^{2b} P(z) + ...$ so the coefficients of $P$ are directly determined by the first $b$ terms.