Originally Posted by

**Unbeatable0** From my previous post here we know that $\displaystyle S_p^n \equiv 0 \pmod{p}$ when $\displaystyle 0\le n \le p-2$.

If $\displaystyle n=k(p-1)$ for some $\displaystyle k\in\mathbb{N}$ then $\displaystyle S_p^n \equiv p-1 \pmod{p}$ by Fermat's Little Theorem. Otherwise, for $\displaystyle n \ge p-2$ which is not divisible by $\displaystyle p-1$ we get $\displaystyle S_p^n \equiv S_p^r \pmod{p}$ where $\displaystyle 1 \le r \le p-2$ is the remainder of $\displaystyle n$ upon division by $\displaystyle p-1$. So again we obtain $\displaystyle S_p^n \equiv 0 \pmod{p}$. In conclusion:

For $\displaystyle n=k(p-1)$, $\displaystyle k\in\mathbb{N}$ we have $\displaystyle S_p^n \equiv p-1 \pmod{p}$, and otherwise $\displaystyle S_p^n \equiv 0 \pmod{p}$.