4. Problem: Let $p$ be a prime and let $f(x)=a x^{2}+b x+c$ be a quadratic polynomial with integer coefficients such that $0<a, b, c \leqslant p$. Suppose $f(x)$ is divisible by $p$ whenever $x$ is a positive integer. Find all possible values of $a+b+c$.
Solution: (James Xu)
First substitute $x=p$, to get $p \mid a p^{2}+b p+c$ so $p \mid c$. Therefore $c=p$. Next substitute $x=1$, to get $p \mid a+b+c$. Since $c=p$, this gives us $p \mid a+b$. Finally substitute $x=p-1$, to get $(p-1)^{2} a-(p-1) b+c \equiv 0(\bmod p)$. Thus $a-b+c \equiv 0(\bmod p)$, and since $c=p$, we get $p \mid a-b$. Adding and subtracting $p \mid a+b$ and $p \mid a-b$ we get
$$
p \mid(a+b)+(a-b)=2 a \quad \text { and } \quad p \mid(a+b)-(a-b)=2 b .
$$

Now there are two cases: either $p=2$ or $p$ is odd.
- Case $1 p=2$ :
$2 \mid a-b$ means that either $a=b=1$ or $a=b=2$, i.e. the only two possibilities for $(a, b, c)$ are $(1,1,2)$ and $(2,2,2)$. So the only candidate polynomials are
$$
x^{2}+x+2 \quad \text { and } \quad 2 x^{2}+2 x+2 \text {. }
$$

Now we check that these work. If $f(x)=x^{2}+x+2=2+x(x+1)$ which is always even because both 2 and $x(x+1)$ are even for all integers $x$. If $f(x)=2 x^{2}+2 x+2=2\left(x^{2}+x+1\right)$ which is always even because it has a factor of 2 .
- Case $2 p$ is an odd prime:
Since $(2, p)=1, p \mid a$ so $a=p$. Also note that $p \mid 2 b$ by subtracting $a-b$ from $a+b$, so by a similar argument, $b=p$. Thus, $a+b+c=p+p+p=3 p$

Combining the two cases, $a+b+c=3 p$ for all $p$ and $a+b+c=4$ when $p=2$ are the only possible values of $a+b+c$.