Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

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

Iam trying to solve $a^b = f_1$ , $a^c = f_2$, I know the answer will get infinite set of answers. but can I solve it in Natural numbers , hence $a$, $b$, $c$, $f_1$, $f_2$ are natural numbers and $f_1$ and $f_2$ are known ?

share|cite|improve this question
up vote 1 down vote accepted

Let $p$ be a prime dividing $f_1$, and $p^n$ the greatest power of $p$ dividing $f_1$. Similarly, let $m$ be the greatest power of $p$ dividing $f_2$. Let $g = \gcd(m,n)$. Then if $f_1$ and $f_2$ can be written in the form you've stated, then $a = f_1^{g/n}, b = n/g, c = m/g.$

Alternatively, if $f_1$ and $f_2$ are of that form, then $\log f_1/\log f_2$ is a rational number. Find it in lowest terms using e.g. continued fractions; it's then $b/c$. Finally, set $a=f_1^{1/b}$.

share|cite|improve this answer
This will get one answer. Then if the $a$ you find is a power, you can use the laws of exponents to find some more. For example, if $a=d^2$, then $d^{2b}=f_1, d^{2c}=f_2$ is another. – Ross Millikan Feb 26 '13 at 18:37
how to get the prime dividing of f1, how to get p ? – Max Feb 26 '13 at 18:46
@Max You will need to use a factorization algorithm; for instance, if $f_1$ is not too large, trial division. – user7530 Feb 26 '13 at 18:48

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.