What ordinals correspond to tuples ordered lexicographically?

Solution 1:

Remember that ordinal multiplication is NOT commutative.

You don't want $n_{k-1} \cdot \omega$ because that equals $\omega$.

You should write

$$\omega^{k-1} \cdot n_1+\cdots+ \omega \cdot n_{k-1} +n_k$$