Problem

Source: RMM Shortlist 2016 N1

Tags: number theory, primitive root, Quadratic Residues



Determine all integers $n \ge 3$ whose decimal expansion has less than $20$ digits, such that every quadratic non-residue modulo $n$ is a primitive root modulo $n$. An integer $a$ is a quadratic non-residue modulo $n$, if there is no integer $b$ such that $a - b^2$ is divisible by $n$. An integer $a$ is a primitive root modulo $n$, if for every integer $b$ relatively prime to n there is a positive integer $k$ such that $a^k - b$ is divisible by $n$.