I'm trying to understand a proof regarding radix-sort but to no avail.
I'll first write down a brief summary of the proof and then assign some questions which I hope will be clarified enough.
Suppose you have an array of integer numbers in the range $\{0,1,2,\ldots n \log n\}$. Show and explain an effective algorithm in the worst case which finds out if there are two elements with the same value. note - You can use an extra memory in order of magnitude equals to $O(n)$.
I don't really care about how the algorithm will look like. The idea to this proof is using radix-sort in $O(n)$ and then looking for two elements with the same value as the array is sorted.
The proof outline:
Let's suppose we are examining a larger domain which is $\{0,1,2 ,\ldots n^2 - 1\}$. Now we'll treat each number according to its binary representation using radix-sort bit by bit.
Right after this, comes the part I can't understand at all....
As we know the order of magnitude of radix-sort is $\Theta(d(n+k))$ and therefore all we have to decide is which a to choose to have order of magnitude equals to $O(n)$.
using the formula $\frac{2\log n}{a} (n + 2^a)$.
After this step, you just choose $a = \log n$ and you are done.
My questions are:
How did the writer concluded the following formula: $\frac{2\log n}{a} (n + 2^a)$?
Also, why do the writer prefer to work on the domain of $\{0,1,2 ,\ldots n^2 - 1\}$ instead the one given in the question?