Here is the original question:
Natural numbers $n$, $k$ are given such that for any prime $p$ there exists an integer $a$ satisfying the condition $p\mid a^k-n$. Decide whether $n$ must necessarily be the $k$-th power of a natural number.
Let $x, n > 1$ be integers. Suppose that for each $k > 1$ there exists an integer $a_{k}$ such that $x − a_k^n$ is divisible by $k$. Prove that $x = A^{n}$ for some integer $A$.
Nice proof by Bill Dubuque:
Choose $\,k=x^2\Rightarrow\,x^2\mid x-a^n\Rightarrow\, x\mid a^n\,$ so $\ \color{#c00}{ a^n\! = mx}\ $ so ${\ jx^2\! = x-\!\overbrace{mx}^{\large\ a^n}}\, $ for some integers $\,j,m.\,$ Notice $\,m = 1-jx\,$ is coprime to $\,x,\,$ so like $\,\color{#c00}{a^n,\ m\ \&\ x}\,$ must be $\,n$'th powers too.
Is there any way to write similar answer to the original task?