Given a function $f(x)$, is there an analytic way to determine which integer values of $x$ give an integer value of $f(x)$?

359 Views Asked by At

Basically, I have some function $f(x)$ and I would like to figure out which integer values of $x$ make it such that $f(x)$ is also an integer. I know that I could use brute force and try all integer values of $x$ in the domain, but I want to analyze functions with large (possibly infinite) domains so I would like an analytical way to determine the values of $x$.

The function itself will always be well-behaved and inversely proportional to the variable. The domain will be restricted to the positive real axis.

I thought about functions like the Dirac delta function but that only seemed to push the issue one step further back. I get the feeling that I am either going to be told that there is no way to easily determine this, or that I am misunderstanding something fundamental about functions, but I thought I'd let you all get a crack at it at least.

1

There are 1 best solutions below

2
On BEST ANSWER

It's not just "some function", if it's inversely proportional to the variable $x$ that means $f(x) = c/x$ for some constant $c$. If there is any $x$ such that $x$ and $c/x$ are integers, that means $c = x c/x$ is an integer. The integer values of $x$ for which $c/x$ is an integer are then the factors of $c$. If the prime factorization of $c$ is $p_1^{n_1} \ldots p_m^{n_m}$ (where $p_i$ are primes and $n_i$ positive integers), then the factors of $c$ are $p_1^{k_1} \ldots p_m^{k_m}$ where $k_i$ are integers with $0 \le k_i \le n_i$ for each $i$.