Problem

Source: 2015 Saudi Arabia JBMO TST 3.2

Tags: combinatorics, Digits, odd



Let $A$ and $B$ be the number of odd positive integers $n<1000$ for which the number formed by the last three digits of $n^{2015}$ is greater and smaller than $n$, respectively. Prove that $A=B$.