# When does a rational function have infinitely many integer values for integer inputs?

Consider rational functions $F(x)=P(x)/Q(x)$ with $P(x),Q(x) \in \mathbb{Z}[x]$. I'd like to know when I can expect $F(k) \in \mathbb{Z}$ for infinitely many positive integers $k$. Of course this doesn't always happen ($P(x)=1, Q(x)=x, F(x)=1/x$). I am particulary interested in answering this for the rational function $F(x)=\frac{x^{2}+3}{x-1}$.

-
–  David Speyer Sep 7 '10 at 12:47
Heh, just finished doing that. –  Cam McLeman Sep 7 '10 at 13:08
In the second line, I think that you should delete $[x]$. –  John Bentin Sep 7 '10 at 13:11

If $F=P/Q$ is integral infinitely often then $F$ is a polynomial.

Write $$P(x)=f(x)Q(x)+R(x)$$ for some polynomial $R$ of degree strictly less than the degree of $Q$. If you have infinitely many integral $x$ so that $P/Q$ is integral then you get infinitely many $x$ so that $NR/Q$ is integral, where $N$ is the product of all denominators of the coefficients in $f$. However $R/Q\to 0$ as $x\to \pm \infty$ so $R\equiv 0$ and so $Q(x)$ is a divisor of $P(x)$.

Now, as pointed out by Mark Sapir below, not all polynomials with rational coefficients take on integer values infinitely often (at integers), but you can check this in all practical cases by seeing if $dF$ has a root $\pmod{d}$, where $d$ is the common denominator of the coefficients in $F$.

-
Not quite because $f$ may have rational coefficients. Example: $(2x+1)/3$. –  Mark Sapir Sep 7 '10 at 12:51
True, I just assumed $f$ had integral coefficients and it is obvious how to reduce to this case, just multiply the equation with the common denominator of the coefficients of $f$! –  Gjergji Zaimi Sep 7 '10 at 12:58
Still too fast and not quite correct. Example: $(2x+1)/2$. No integer values, but it is a polynomial (over rationals). –  Mark Sapir Sep 7 '10 at 13:05
I've always been bothered by this argument, because it seems a pain to have to use analysis (even in the very weak form that a rational function of negative degree tends to $0$) to prove a purely algebraic fact. (Insert obligatory Fundamental-Theorem-of-Algebra remark here.) Do you know if there is any way to avoid it? –  L Spice Sep 7 '10 at 14:18
I think the only thing remaining to be said is that if $F$ is a polynomial then it takes on integer values on a finite (possibly empty) union of arithmetic progressions. In particular, it is integral infinitely often or never at all; there's nothing in between. –  Gerry Myerson Sep 8 '10 at 0:09

$(x^2+3)/(x-1)=x+1+(4/(x-1))$ so this question, at least, is easy; you get an integer if and only if 4 is a multiple of $x-1$.

-
It seems odd to leave off the punchline that this happens only for x=2,3, or 5. –  Cam McLeman Sep 7 '10 at 13:11
Cam, also for $x = 0, -1, -3$, of course. –  L Spice Sep 7 '10 at 14:16
@L Spice: Doh. –  Cam McLeman Sep 7 '10 at 16:08
@Cam, I wanted to leave something for OP to do. @L Spice, OP asked for positive integer arguments, so -1 for 0, -1, and -3. –  Gerry Myerson Sep 8 '10 at 0:02
@Gerry, oops, sorry. I assume that negative points for a negative answer is a net positive somehow? –  L Spice Sep 11 '10 at 6:35