Prove $pqr\:|\:n$ or give a counterexample Let $p,q,r$ be distinct primes and let $a$ be an integer. 
Integer $n =  a^{pqr} - a^{qr} - a^{pr} + a^{r} - a^{pq} + a^{q} + a^{p} -a$. 
Prove that $pqr\:|\:n$ or give a counterexample
I am trying to use a rule we used in class that $pqr\:|\:(a^{pqr} - a)$ but my factoring is a mess. Thank you!
 A: HINT:
$$\text{For }a^{pqr}-a^{qr}-a^{qr}-a^{rp}+a^p+a^q+a^r-a$$
Using Fermat's Little Theorem $\displaystyle b^p-b\equiv0\pmod p$ for any integer $b$
$$(a^{qr})^p-(a^{qr})\equiv0\pmod p $$
$$(a^{r})^p-(a^r)\equiv0\pmod p $$
$$(a^{q})^p-(a^q)\equiv0\pmod p $$
$$a^p-a\equiv0\pmod p$$
A: Hint $\ $ Let $\,f\{p_1,\dots,p_k\} = a^{\large p_1\cdots p_k}$ so $\,{\rm mod}\ \color{#c00}p\!:\ f\{\color{#c00}p,q,r\} = a^{pqr}\! = (a^p)^{qr}\overset{\rm Fermat}\equiv a^{qr} = f\{q,r\}.\,$   
Similarly $\,f\{\color{#c00}p,m\} \equiv f\{m\},\ \ f\{\color{#c00}p\}\equiv f\{\,\}\,$ i.e. we can delete all $\,\color{#c00}p$'s, $ $  therefore 
$\quad \begin{eqnarray} {\rm mod}\ \color{#c00}p\!:\,\ n &=& f\{p,q,r\} \color{}{- f\{q,r\}} \color{}{- f\{r,p\}} \color{#0a0}{- f\{p,q\}} \color{brown}{+ f\{r\}} + f\{q\} + f\{p\} - f\{\,\} \\
&\equiv&  \underbrace{f\{\color{#c00}p,q,r\} \color{}{- f\{q,r\}}}_{\large \equiv\,0}\:   \underbrace{ -\, f\{r,\color{#c00}p\} \color{brown}{+ f\{r\}}}_{\large \equiv\,0}\, \underbrace{\color{#0a0}{-\, f\{\color{#c00}p,q\}}+f\{q\}}_{\large \equiv\,0}   +\underbrace{ f\{\color{#c00}p\} - f\{\,\}}_{\large \equiv\,0}\phantom{I^{I^I}}
\end{eqnarray}$
So $\,p\mid n,\,$ By symmetry $\ q,r\mid n,\ $ so $\ {\rm lcm}(p,q,r) = pqr\mid n\,$ by $\,p,q,r\,$ pairwise coprime. $\  $ QED
