If $r^{n-r}=k^{n-k}$, when is this true other than $r=k$? Let $n,r,k$ be non negative integers such that $r,k\leq n$.
If $r^{n-r}=k^{n-k}$, when is this true other than $r=k$ ?
For example it is holds for $n=6,r=2,k=4$.
 A: This equation has many solutions. I have no general form to find all these solutions, but if you're just interested in finding some other values for which it holds, you can do the following:
$$r^{n-r} = k^{n-k} \quad\Longrightarrow\quad 1=\frac{k^{n-k}}{r^{n-r}}=\left(\frac{k}{r}\right)^{n-r}k^{r-k} \quad\Longrightarrow\quad k^{k-r}=\left(\frac{k}{r}\right)^{n-r}.$$
This leads to an expression for $n$, depending on $r$ and $k$:
$$n=r+\frac{\ln{k}}{\ln{k}-\ln{r}}(k-r).$$
You can choose any $r$ and $k$ and the equation will give you $n$. You can make a loop going over many $r$'s and $k$'s and check if the corresponding $n$ is an integer.
For example, in Matlab you could do:
for r = 1:r_end
  for k = 1:k_end 

    n = r + log(k^(k-r)) / (log(k)-log(r));
    if mod(n,1) == 0
      disp(['r = ', num2str(r), ' , k = ', num2str(k), ' , n = ', num2str(n)])
    end

  end
end

This gives many solutions, such as $[r,k,n] = [27,3,39]$, $[49,7,91]$ or $[9,81,153]$.
A: We have that $n,r,k$ be non negative integers such that $r,k\leq n$.
First of all $(r,k,n)=(0,0,n)$, where $n \neq 0$ is a trivial solution for $r^{n-r} = k^{n-k}$.
For further solutions, we have
$$\begin{align}
r^{n-r} & = k^{n-k} \\
(n-r) \cdot \ln r & = (n-k) \cdot \ln k \\
n & = {\frac{r\ln r - k\ln k}{\ln  r - \ln k}}.
\end{align}$$
Now to provide, that $n$ is an integer let $a$ be a nonnegative integer, and take $k=r^a$. If $a=1$, then $r=k$ and then if $r=k=0$, then $n\neq r$, but else $n$ could be anything. If $a \neq 1$, then
$$n = \frac{r-ar^a}{1-a},$$
which is an integer for appropriate $(r,a)$ pairs. I don't know a condition for this.
So I think there are infinitly many solutions in the form
$$(r,k,n) = \left(r,r^a,\frac{r-ar^a}{1-a} \right).$$
If you can find such condition for $n$, that when is it integer, then you could find all solutions.
Examples: $(2,4,6), (2,8,11), (3,9,15), (3,27,39), (3,81,107), (3,243,303) (4,16,28), (4,64,94), (4,256,340), (4,1024,1279), (5,25,45), \ \dots$
