Two integer numbers $a$ and $b$, I have to determine how many ways I can get such $c$ and $d$ so that $c \neq a$ and $d \neq b$ but $a^b = c^d$ where $a, b, c$ and $d$ are positive integers.
What are the ways to get that value?
For example, $4^2 =2^4=16^1$, here, $a=4, b=2$ and $c=2,16, d=4,1$
A positive integer $a$ has a unique prime factorization such that $a=p_1^{n_1}\cdot p_2^{n_2}\cdot\ldots p_r^{n_r}$. Let $g_1,\ldots,g_k$ be the $k$ common divisors of $n_1,\ldots,n_r$. Thus
$$a=\prod_{i=1}^r\left(p_i^{n_i/g_j}\right)^{g_j}\quad j\in[1,k]$$.
So there are $k$ ways of representing any positive integer $a$ in the fashion you described.
Feel free to comment if I forgot some details or if I'm plain wrong.