find all solutions of $a^b=b^{a-3}$ over integers. find all solutions of $a^b=b^{a-3}$ over integers.
I used the method of taking $\gcd(a,b)=d$ and simplifying the equation(this method is usually useful in this kind of questions a similar question in IMO is proved in this way.).I also tried the method of solving with factorization in that method we can prove if $a>b$ then $a \mid b$ but non of them worked.
 A: *

*$b=0$ leads to $a^0=0^{a-3}$ with only solution $a=3$.

*$b=1$ leads to $a=1$

*$b=-1$ leads to $\frac 1a=(-1)^{a-3}=\pm1$, but only $a=1$ works.


In all other cases, $b$ is divisible by at least one prime.
Also, we may assume $a\ne 3$ (because $a=3$ leads to $b=0$ again).
Let $p$ be a prime dividing $b$ and occuring in $b$ to the $k$th power (i.e., $p^k\mid b$, $p^{k+1}\nmid b$) with $k\ge 1$.
Then $p$ occurs in $b^{a-3}$ to the $(a-3)k$th power, hence in $a$ to the $\frac{(a-3)k}{b}$th power. In particular, $p\mid a$.
For $p\ne 3$, the pact that $\frac{(a-3)k}{b}$ is an integer and $\gcd(a-3,p)=1$ implies that $p^k\mid k$, which is absurd.
We conclude that $b$ is $\pm$ a power of $3$, $b=\pm3^k$, in particular, $b$ is odd.
On the other hand, if $q$ is a prime dividing $a$, we similarly find that $q\mid b$, hence $q=3$.
Then $3$ occurs in $a-3$ at most to first power. As $\frac{(a-3)k}{3^k}$ must still be an integer, $3^{k-1}\mid k$, we conclude $k=1$, so $b=\pm3$. So $a^3=3^{a-3}$, and with $a=3^m$, 
$ 3^{3m}=3^{3^m-3}$, $m=2$, $a=9$.
$$ (a,b)=(3,0), (1,1), (1,-1), (9,3).$$
A: Clearly $p\mid a\Longleftrightarrow p\mid b$, so we can write the prime factorizations of $a$ and $b$ as
$$\begin{array}{c}
a=p_1^{\alpha_1}p_2^{\alpha_2}\dots p_m^{\alpha_m} \\
b=p_1^{\beta_1}p_2^{\beta_2}\dots p_m^{\beta_m}
\end{array}$$
With this we see that $a$ and $b$ are solutions if and only if $\alpha_i b=\beta_i(a-3)$ for all $1\le i\le m$. This gives that
$$\frac{b}{\gcd(b,a-3)}\mid \beta_i$$
However this requires $b\le \beta_i\gcd(b,a-3)$. If $3\nmid a$ then $\gcd(b,a-3)=1$ and this clearly does not hold if $b\neq 1$. If $b=1$ then the pair $a=1,b=1$ works. If $3\mid a$ then $\gcd(b,a-3)=3$ and $b\le 3\beta_i$, however this clearly doesn't hold if $b$ has more than two distinct prime factors, so in this case $b=3^{\beta}$. However we still must have $3^{\beta}\le 3\beta$ which restricts $\beta$ to $1$. So $b=3$ at which point we see $a=9$ satisfies $a^3=3^{a-3}$. So if $a,b\in\mathbb{N}$ then the solution pairs $(a,b)$ are $(1,1)$ and $(9,3)$.
Extending this to all integers shouldn't be hard by consider different combinations of when $a$ and $b$ are positive and negative. Simply check that both sides are integers or non-integers (for example one side can't be raised to a positive exponent and the other side a negative one). If they are both non-integers take the reciprocals of both sides and apply the same argument as above for when $a,b\in\mathbb{N}$.
