The following question is motivated by an answer that got deleted.
So I ask, is the following true?
Let $q$ be prime and integer $n$ be given with $2 \le n \lt q$ . Then there exist a prime factor $p$ of $n$ and an integer $k \ge 1$ such that
$\quad n \equiv p^k \pmod q$
If this is true, is there a more precise statement and/or some available links?
My work
For the number $10 = 2 \times 5 \lt 19$,
$\quad 2^{17} \equiv 10 \pmod {19}$
but
$\quad 5^{k} \equiv 10 \pmod {19}$
has no solutions.
If I'm reading your question right, and my calculations are correct, $q = 31$, $n = 10$ is a counterexample, since the powers of $2$ modulo $31$ are $1$, $2$, $4$, $8$, $16$, and the powers of $5$ are $1$, $5$, $25$.
Here is the code I wrote:
With the first 10 examples it finds being: