For $a=1$ the problem reduces to $0\mid0$, which is true, so this is another (trivial) solution. Now let $a>1$. By Korselt's criterion, as linked in the comments, $a-1$ has to be squarefree, and for every prime $p$ dividing $a-1$, we must have $p-1\mid a-1$. We will show that the only possible values of $a-1$ are $1,2,6,42,1806$. One easily checks that $1807=13\cdot139$ doesn't satisfy the original problem, so the full list of solutions is $$\boxed{a\in\{1,2,3,7,43\}.}$$
Let $A$ be the set of all squarefree $n$ such that $p\mid n$ implies $p-1\mid n$ for all primes $p$. Call a prime $p$ an $A$-prime if $p\mid n$ for some $n\in A$. From the examples we found, we know that $2,3,7,43$ are $A$-primes. Assume there is another $A$-prime, let $p$ be the smallest one, and say $p\mid n$ for $n\in A$. Then $p-1\mid n$, so every prime factor of $p-1$ is an $A$-prime, and by minimality of $p$ must be in $\{2,3,7,43\}$. Therefore $p=1+\prod_{q\in S}q$ for some $S\subseteq\{2,3,7,43\}$. (Remember that $n$, and therefore $p-1$, is squarefree.) But a direct computation shows that no choice of $S$ yields a new prime, contradiction.
Hence $2,3,7,43$ are the only $A$-primes. Now if $43\mid n\in A$, then also $42\mid n$, so $n=2\cdot3\cdot7\cdot 43$, and similarly for the other cases. This completes the proof.
$$n^a-n = af(a)$$ $a\forall ,\text{primes}$
$$n^a-n = a(a-1)f(a)$$ $a\in (2,3,7,43)$
$$n^a-n = a (a-1)(a-2)f(a)$$ $a=3$
$$n^a-n = a(a-1)(a-2)(a-3)f(a)$$ no solution to this and higher
– Aderinsola Joshua Dec 12 '24 at 12:52