Let A and B be some number, integer or decimal.
I want to figure out the lowest possible integer X that will yield another integer Y in the following formula.
(A * X) / B = Y
Using some concrete numbers, say A = 55 and B = 2.25.
Then, applying the above formula, you get
(55 * X) / 2.25 = Y
By trial and error, I was able to figure out that X has to be 9 in order to yield a value for Y that is another integer.
This is feels like a common denominator type of a problem, but I can't figure out how to get X without doing a trial and error.
Hello doolindaltonFirst of all, note that this is not always possible. For example, if and , then there are no integers for which .
Why? Substituting and re-writing the equation, we get
,
and it is well-known that is irrational; in other words, it can't be written in the form , where are integers.
So, when can we solve the problem? If we re-write the equation yet again, we get
So the answer is that has to be rational. It doesn't mean that individually and must be rational - for example, and - but when we divide by , the answer must be rational. So that means that we must be able to write
, for some integers
So, assuming that we can do that, we then express in its lowest terms, by 'cancelling' if necessary. Then, with being the smallest possible integer for which is an integer, the resulting value of gives the smallest possible value of .
Let's see how this works with the example you gave: :
So there are our values of and . And there's your answer: .
Grandad