Find all pairs (a,p) of positive integers, where p is a prime, such that for any pair of positive integers m and n the remainder obtained when a2n is divided by pn is non-zero and equals the remainder obtained when a2m is divided by pm. number theoryremainderprimeJuniorBalkanshortlist