Problem

Source: 2018 Balkan MO Shortlist N5

Tags: number theory, Balkan MO Shortlist



Let $x,y$ be positive integers. If for each positive integer $n$ we have that $$(ny)^2+1\mid x^{\varphi(n)}-1.$$Prove that $x=1$. (Silouanos Brazitikos, Greece)