Why does $N$ divide $\sum_{d|N} p^{md} \mu\bigg(\frac{N}{d}\bigg)$? Let $p$ be a prime and $m,N$ positive integers.  Then 
$$
N | \sum_{d|N} p^{md} \mu\bigg(\frac{N}{d}\bigg). \tag{1}
$$
For example with $p=7,m=2$ and $N=12$, we find that $7^{24}-7^{12}-7^8+7^4 \equiv 0$ $\pmod{12}.$
This relation must hold for the following reason:  Let $q=p^m$ and consider the finite field $F_{q^N}$ having $q^N$ elements.
Every element of $F_{q^N}$ is a root of exactly one polynomial irreducible over $F_q$ whose degree must be a divisor of $N$, so
$$
q^N = \sum_{d|N} d \pi_d
$$ 
where we denote by $\pi_d$ the number of irreducible polynomials of degree $d$ in $F_q[x].$
Mobius' inversion formula then gives
$$
N\pi_N = \sum_{d|N} q^d \mu\bigg(\frac{N}d \bigg),
$$
which implies (1). 
Question Although this well-known argument is straightforward, I wonder if there is a demonstration of the divisibility result (1) using only elementary number theory without invoking the theory of finite fields. 
 A: The primary source for my answer is the  "Number of non periodic strings" answer.
Consider a string of $N$ letters, each of which could be one of $q$ different letters.  Then there are $q^N$ strings.  As we shift the letters one position at a time to the right with the last letter moving to the first position at each shift, the strings formed will periodically look like the original string.  For example, if all the letters are the same, the period is $1$; the string $bcbcbc$ has period $2$; and if no two letters are the same, the period is $N$.  If the smallest period of a string is equal to the string's length, then the string is aperiodic.  Let $A_q(d)$ denote the number of aperiodic strings of length $d$ from an alphabet of $q$ letters.
For each $d$ that divides $N$, we can make a string of $N$ letters by repeating $N/d$ times an aperiodic string of $d$ letters.  If we do that for each $d$ and each aperiodic string of $d$ letters, we will make all $q^N$ strings.  Hence
$$q^N = \sum_{d|N} A_q(d).$$
The Möbius inversion formula then gives
$$A_q(N) = \sum_{d|N} \mu(d) q^{N/d} = \sum_{d|N} q^{d} \mu\left( \frac Nq \right). \tag{2}$$
Now $A_q(N)$ is divisible by $N$ because an aperiodic string of length $N$ yields $N - 1$ more aperiodic strings by shifting the letters to the right as described above.  So the right side of $(2)$ must also be divisible by $N$.  Another way to see that is to consider an aperiodic necklace of $N$ letters.  We can cut the necklace at $N$ places to make $N$ aperiodic strings.  So $A_q(N)/N$ is the number of aperiodic necklaces and is therefore an integer. Thus, 
$$N \bigg| \sum_{d|N} q^{d} \mu\left( \frac Nq \right).$$
