# Modulo Prime Power

Let $N$ be the sum of all positive integers $q$ of the form $q=p^k$ with prime $p$, such that for at least four different integer values of $x$ from $1$ to $q$,

$x^3-3x\equiv 123 \pmod{q}.$

What are the last 3 digits of $N?$

×