Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

share|cite|improve this question
Although I am far from being an authority on the case, my intuition says that without further constraints on $f$ this is somewhat impossible, and I would be indeed very surprised to see a positive answer. If you have any other constraints on the function, I would suggest you add them to perhaps allow some latitude in which a positive answer can sneak onto the function. – Asaf Karagila Sep 20 '11 at 23:06
I don't think there's any general method for your problem. Isn't there anything special about $f$? – J. M. Sep 20 '11 at 23:29
@Asaf: Sure, the function itself will always be well behaved and a simple inverse relation to the variable (i.e. $f(x) \propto \frac{1}{x}$), and the domain will always be positive and real. – AdamRedwine Sep 21 '11 at 1:32
up vote 4 down vote accepted

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$.

share|cite|improve this answer
Note the factors can also be negative. – anon Sep 21 '11 at 6:04
Yes, that is indeed the case. I know I was performing factorization but I didn't know much of the history behind attempts to do so other than by brute force. I did a bit of reading on diophantine equations and the problem is not encouraging. Thanks. – AdamRedwine Sep 21 '11 at 12:04

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.