Maths WorkshopMaths problems with full solutions
Exercise 1655Number theory › Divisibility and gcdOlympiadAdded 3 Nov 2026

GCD of polynomial coefficients

#gcd#coefficients#polynomials

Statement

Let P(X)=anXn+⋯+a0∈Z[X]P(X)=a_nX^n+\cdots+a_0\in\mathbb{Z}[X]. Show that if a prime pp divides all coefficients except possibly aka_k, then PP has a root mod pp only if ak≡0(modp)a_k\equiv0\pmod p.

Hint

Reduce PP mod pp: P≡akXk(modp)P\equiv a_kX^k\pmod p.

Show solutionHide solution

Solution

Reduction. Mod pp, P(X)≡akXk(modp)P(X)\equiv a_kX^k\pmod p.

Root condition. If α∈Z/pZ\alpha\in\mathbb{Z}/p\mathbb{Z} satisfies P(α)≡0P(\alpha)\equiv0, then akαk≡0a_k\alpha^k\equiv0.

Conclusion. If ak≢0a_k\not\equiv0, then α=0\alpha=0 is the only possible root, and it satisfies P(0)≡a0≡0P(0)\equiv a_0\equiv0 automatically. If a0≢0a_0\not\equiv0 and ak≢0a_k\not\equiv0, PP has no root mod pp.