# Conditions for polynomial $f$ such that $f(n) \in \mathbb{N}$ for enough $n \in \mathbb{N}^+$ implies $f$ has rational coefficients

This question is suggested by this one: prove: coefficients of $f(x)$ are rational numbers

What are the weakest sufficient conditions and strongest necessary conditions on a set of positive integers $S$ such that if $f$ is a polynomial with complex coefficients and $f(n)$ is an integer for all $n \in S$, then all the coefficients of $f$ are rational numbers?

That question shows that a sufficient condition is that $S$ contains all positive integers.

I conjecture that a necessary condition is that, for every prime $p$, $p \in S$.

There may be a similar sufficient condition something like "for all prime powers $p^k$ there is a $n \in S$ such that $p^k | n$."

Can there be such an $S$ with density zero? If not, how small can $\frac{\#\{k|(k \le n) \land (k \in S)\}}{n}$ be?

How about $\sum_{n \in S} \frac1{n}$ diverges?

An intuitive form of this might be:

How "thin" can $S$ be and still force $f(n) \in \mathbb{N}$ for all $n \in S$ implies that the coefficients of $f$ are rational.

How "thick" can $S$ be while a polynomial $f$ with at least one non-rational coefficient exists such that $f(n) \in \mathbb{N}$ for all $n \in S$.

• Wouldn't any infinite subset of $\mathbb{N}$ satisfy this property ? – Joel Cohen Oct 7 '13 at 6:12
• And, conversely, no finite set will do, since you can take a polynomial that vanishes on a finite set and multiply it by an arbitrary complex number. – Gerry Myerson Oct 7 '13 at 6:16
• I'll think about these comments tomorrow. There might be less to this than meets the eye. – marty cohen Oct 7 '13 at 6:26
• For a polynomial $f(x)$ of degree $n$, \begin{align} & \text{all coefficients of } f(x) \text{ are rational}\\ \implies & f(x) \text{ are rational for all rational } x\\ \implies & f(x) \text{ are rational for infinitely many rational }x \\ \implies & f(x) \text{ are rational for } n + 1 \text{ integral x}\\ \implies & \text{all coefficients of } f(x) \text{ are rational} \end{align} In the last step, we have used Lagrange interpolation formula to express $f(x)$ in terms of its values of any $n+1$ integers. – achille hui Oct 7 '13 at 8:00