Given $a$ and $b$.Find $x$ and $y$ such that $$a^x = b^y$$ $$a, b, x, y \in \Bbb N^+$$
If any $x$ and $y$ exists.
In my actual problem I know that $x$ and $y$ both $< 6$ (but I'm looking for a general solution, that is, not a brute force search over 25 possibilities).
$a$ and $b$ can be as low as $2$ or as high as $60000000$.
Examples
- $a = 4, b = 8, x = 3, y = 2$
- $a = 2, b = 2^{20}, x = 20, y = 1$
- $a = 49, b = 7, x = 1, b = 2$
Possible solution (please comment)
Prime factorization of both $a$ and $b$ gives:
$$a = {p_1}^{e_1} {p_2}^{e_2} {p_3}^{e_3} ... {p_n}^{e_n}$$ $$b = {q_1}^{f_1} {q_2}^{f_2} {q_3}^{f_3} ... {q_n}^{f_n}$$
($p_i$ and $q_i$ prime, $p_1 < p_2 < p_3 < ... < p_n$, $q_1 < q_2 < q_3 < ... < q_n$, $e_i$ and $f_i$ positive integer)
If for any $i$, $p_i \neq q_i$ then no solution exists.
Otherwise let $$m = LCM(e_1, f_1)$$ $$x = m/e_1$$ $$y = m/f_1$$
Then $x$ and $y$ will be the solution iff $$x e_i = y f_i$$ for every $1 \le i \le n$
The existence of $x$ and $y$ depends on the prime factorisation of $a$ and $b$.
Let $a=\prod_{n=1}^f {p_n}^{c_n}$ and $b=\prod_{n=1}^g {q_n}^{d_n}$ (both in the form of their prime factors).
Obviously, without loss of generality,
1) $f=g$
2) $p_n=q_n$ for all $n$
3) $xc_n=yd_n$ for all $n$
In other words, the ratio of the exponents within the factorisation must be the same in both numbers. In all other cases, $a^x\neq b^y$.