This is problem 6 from 2.1 in Koblitz's "Introduction to Elliptic Curves and Modular Forms," self-study.
Given a sequence $N_r, r = 1, 2, ...$, let
$$Z(T) = \operatorname{exp} \Big(\sum_{r = 1} N_r \frac{T^r}{r} \Big)$$
Suppose $l$ is a prime and $q$ is a power of a prime $p$ such that $q \equiv 1 \mod l$ and $q \not\equiv 1 \mod l^2$. $N_r$ is the number of $x \in \mathbb F_{q^r}$ such that $x^{l^M} = 1$. Find $Z(T)$.
It seems to be the best place to start is to compute $N_r$. This is the number of $x$ such that the multiplicative order of $x$ divides $l^M$. Every element in the multiplicative group has order dividing $q^r - 1$. Combining both conditions gives us that we are searching for the number of $x$ such that the multiplicative order of $x$ divides the gcd of $(l^M, q^r - 1)$. Since this is a divisor of $q^r - 1$, this is none other than the gcd itself. Assuming this is all correct, I am unsure how to proceed.