MathCastle
ChallengeSuperchallengeModular Arithmetic

Modular Arithmetic · Superchallenge problem

Find the smallest integer n>1n > 1 such that n2n^2 ends in the same three digits as nn (i.e. n2≡n(mod1000)n^2 \equiv n \pmod{1000}).