Problem

Source: P6, Mexico Center Regional Olympiad 2019

Tags: number theory



Find all positive integers $m$ with the next property: If $d$ is a positive integer less or equal to $m$ and it isn't coprime to $m$ , then there exist positive integers $a_{1}, a_{2}$,. . ., $a_{2019}$ (where all of them are coprimes to $m$) such that $m+a_{1}d+a_{2}d^{2}+\cdot \cdot \cdot+a_{2019}d^{2019}$ is a perfect power.