T. Andreescu, D. Andrica and Z. Feng, 104 Number Theory Problems (from the training of the USA IMO team), Birkhäuser, Boston, 2007, Advanced problem # 19, pp. 85, 145, 146.
Roozbeh Hazrat, Mathematica: A Problem-Centered Approach, Springer 2010, p. 39.