Problem

Source: 2019 USAMO 3, by Titu Andreescu, Cosmin Pohoata, and Vlad Matei

Tags: USAMO, sadder, sad stories, 2019 USAMO Problem 3, Hi, sob



Let $K$ be the set of all positive integers that do not contain the digit $7$ in their base-$10$ representation. Find all polynomials $f$ with nonnegative integer coefficients such that $f(n)\in K$ whenever $n\in K$. Proposed by Titu Andreescu, Cosmin Pohoata, and Vlad Matei