Problem

Source: Romanian IMO Team Selection Test TST 2004, problem 18

Tags: modular arithmetic, quadratics, number theory proposed, number theory



Let $p$ be a prime number and $f\in \mathbb{Z}[X]$ given by \[ f(x) = a_{p-1}x^{p-2} + a_{p-2}x^{p-3} + \cdots + a_2x+ a_1 , \]where $a_i = \left( \tfrac ip\right)$ is the Legendre symbol of $i$ with respect to $p$ (i.e. $a_i=1$ if $ i^{\frac {p-1}2} \equiv 1 \pmod p$ and $a_i=-1$ otherwise, for all $i=1,2,\ldots,p-1$). a) Prove that $f(x)$ is divisible with $(x-1)$, but not with $(x-1)^2$ iff $p \equiv 3 \pmod 4$; b) Prove that if $p\equiv 5 \pmod 8$ then $f(x)$ is divisible with $(x-1)^2$ but not with $(x-1)^3$. Sugested by Calin Popescu.