Problem

Source: IX International Festival of Young Mathematicians Sozopol, Theme for 10-12 grade

Tags: number theory



Find all positive integers $n$ for which the number $\frac{n^{3n-2}-3n+1}{3n-2}$ is whole.

HIDE: EDIT: In the original problem instead of whole we search for integers, so with this change $n=1$ will be a solution.