The factors of $5^n-3^n-2^n$ I have been assigned the following question.

Let $f(n):= 5^n-3^n-2^n$. Prove that
(a) $p$ divides $f(p)$ for each prime $p$;
(b) $p^{k+1}$ divides $f(n)$ for $n=p^k$, with $p=2,3,5$ and $k\geq 0$;
(c) $p^{k+2}$ divides $f(n)$ for $n=p^k$, with $p=19$ and $k\geq 0$.

Progress
I have been able to derive (a) from the Fermat's little theorem. I suspect that (b) and (c) can be reduce to (a), but I have been
unable to do it.

The cases $k=0$ are trivial as $f(p^k)=f(1)=0$.
Lemma. $p^{q^k}\equiv p\mod q$.
By simple induction on $k$, as for $k=0$ is trivially true, suppose $p^{q^k}\equiv p \mod q$. We have
$$
p^{q^{k+1}}=p^{q·q^k}=(p^{q^k})^q
$$
and, by induction, we can complete as
$$
p^{q^{k+1}}=p^{q·q^k}=(p^{q^k})^q \equiv p^q \equiv p
$$
(the latter equivalence is because of Fermat's Small Theorem.) $\qed$

To prove (b) in general, we will use a simple factorization of the generic binomial $x^p\pm y^p$ as $(x\pm y)(\text{another polynomial})$.
The three cases $p=2,3,5$ are similar but slightly different. First, you can remove the term with base $p$, as $p^{k+1}$ divides $p^{p^k}$ because $k+1≤p^k$.
As induction base we state that $5=5^1$ divides $3+2=3^{5^0}+2^{5^0}$ and similarly for the other combinations. Suppose now that $p^{k+1}$ divides $q^{p^k}\pm r^{p^k}$ (bases and signs are not arbitrary, either $p=5$ and sign is $+$, or $q=5$ and sign is $-$).
The trivial factorization of $x^5+y^5$ is $(x+y)(x^4-x^3y+x^2y^2-xy^3+y^4)$, the factorization of $x^3-y^3$ is $(x-y)(x^2+xy+x^2)$ and the factorization of $x^2-y^2$ is $(x-y)(x+y)$. If we set $x=q^{p^k}$ and $y=r^{p^k}$, we have that
$$
q^{p^{k+1}}\pm r^{p^{k+1}} = (q^{p^k})^p\pm(r^{p^k})^p
$$
and, applying the above factorization, we can writ this as a product
$$
(q^{p^k}\pm r^{p^k})(\dots)
$$
By induction hypothesis, the first term is divisible by $p^{k+1}$. The second term is a sum of products of the $x$ and $y$ as defined above, but now you can use again Fermat to show that the whole term is divisible by $p$. First of all, $x\equiv q$ and $y\equiv r$. Now we can calculate each case separately.


*

*$p=5$:


$$
x^4-x^3y+x^2y^2-xy^3+y^4 \equiv 3^4-3^3·2+3^2·2^2-3·2^3+2^4 = 55 \equiv 0 \mod 5
$$


*

*$p=3$:


$$
x^2+xy+x^2 \equiv 5^2+5·2+2^2 = 39 \equiv 0 \mod 3
$$


*

*$p=2$:


$$
x+y \equiv 5+3=8 \equiv 0 \mod 2
$$
So in each case the right term of the multiplication is divisible by $p$.

Solution for (c) follows later.
