Ordering pairs of integers $(n, m)$ by the value of ${k_1}^n{k_2}^m$ Ok, so I have two positive integers $k_1$ and $k_2$ raised to positive integer powers $n$ and $m$ respectively. My question is how could I create a list of $(n, m)$ values such that the corresponding values of ${k_1}^n{k_2}^m$ are in ascending order. Is there a pattern which could be used to create a list of $n$ and then $m$ values, for example? Or perhaps a simple algorithm that could do the trick - I've had a go and didn't seem to get anywhere (without of course using brute force).
If there is a nice solution, something else I would like to know is how this might be extended to the product of any number of integers $k$ and power values.
EDIT: I've just had a go with $k$ values 2 and 3, and have found that for $n$ (the power of 2) the $j^2+j$th $n$ in the list where $j$ is a positive integer seems to be 0.
Thanks :)

Here is an algorithm to generate the first $N$ numbers of the for $k_1^n k_2^m$.
Clearly the first number in the list is zero. After this, note that every following number is $k_1$ or $k_2$ times a previous number. Also, since we generate the list in increasing order, we can multiply each element by $k_1$ and $k_2$ in the increasing order as well. In this fashion, at each step, there are only two candidates for the next element in the sequence: we only need to compare these two to see which of them is larger and move to the next candidate element.
So the algorithm goes as such:
generatelist(k1, k2, N):
  list = {1}
  L = 1 // Current size of list
  p1 = 1, p2 = 1 // Elements of the list to be multiplied by k1 and k2

  while L < N:
    c1 = list[p1] * k1, c2 = list[p2] * k2 // Candidates
    if c1 < c2:
      list.push_back(c1)
      p1 = p1 + 1
    else if c2 < c1:
      list.push_back(c2)
      p2 = p2 + 1
    else:
      list.push_back(c1)
      p1 = p1 + 1
      p2 = p2 + 1
    L = L + 1

  return list

If you want to generate all $N$ elements in the list, this algorithm has $O(N)$ complexity and you can hardly do better asymptotically. If you just want to find the $N$th element, there might be better methods.
If you are looking for a general rule, I doubt that one exists. This problem is equivalent to minimising $n \log k_1 + m \log k_2$, and there is no straightforward rule for that unless the logarithms are rational multiples of each other.
