For $5$ distinct integers $a_i$, $1\le i\le5$, $f(a_i)=2$. Find an integer b (if it exists) such that f(b) = $9$. Here's an interesting question I came across.The person who gave it to me told me that it should not take more than $3$ minutes to solve this question. But I could not find any definite solution :( Maybe you guys could give me some help.Any hints would be appreciated.Here's the question:
Let $f(x)$ be a polynomial with integer coefficients. Suppose for $5$ distinct integers $a_i$, $1\le i\le5$, $f(a_i)=2$. Find an integer b (if it exists) such that f(b) = $9$. 
 A: Since $f(a_i)=2$ for $1\le i\le5$, we have that for some polynomial $g(x)$ with integer coefficients,
$$f(x)=(x-a_1)(x-a_2)(x-a_3)(x-a_4)(x-a_5)g(x)+2.$$
If $f(b)=9$ for some $b\in\Bbb Z$, each $b-a_i$ has to be a divisor of $7$, but there are only four integers($1,-1,7,-7$) which can divide $7$, so $b-a_i$ cannot be all distinct.
This makes a contradiction, so there no exists such $b$.
p.s. Since $1\times-1\times-7=7$, I think that $5$ is not necessary to make a contradiction. $4$ is enough to make that.
A: Key Idea $ $ Generally if a polynomial has many factors then so too will its values. For example if $\,g(x) = (x-a_1)(x-a_2)(x-a_3)(x-a_4)h(x)\,$ for distinct integers $\,a_i\,$ then $\,g(n)\,$ has $\ge 4$ distinct factors, so it has at least $2$ factors $\ne \pm 1,\,$ so $\,g(n)\,$ is not prime. Apply this to $\,g := f\!-\!2.$
Remark $\ $ One can push the key idea to the hilt to obtain a simple algorithm  for polynomial factorization using factorization of its integer values and Lagrange interpolation. The ideas behind this algorithm are due in part to $ $ J. I. Bernoulli (1708), F. T. Schubert (1794), L. Kronecker (1882) and B. A. Hausmann (1937). See this answer for references.
