Problem

Source: Own. Malaysian SST 2023 P7

Tags: number theory



Find all polynomials with integer coefficients $P$ such that for all positive integers $n$, the sequence $$0, P(0), P(P(0)), \cdots$$is eventually constant modulo $n$. Proposed by Ivan Chan Kai Chin