Problem

Source: USAMO 2006, Problem 3, proposed by Titu Andreescu and Gabriel Dospinescu

Tags: algebra, polynomial, modular arithmetic



For integral $m$, let $p(m)$ be the greatest prime divisor of $m.$ By convention, we set $p(\pm 1) = 1$ and $p(0) = \infty.$ Find all polynomials $f$ with integer coefficients such that the sequence \[ \{p \left( f \left( n^2 \right) \right) - 2n \}_{n \geq 0} \] is bounded above. (In particular, this requires $f \left (n^2 \right ) \neq 0$ for $n \geq 0.$)