5. In the language of the "Tekimar" tribe, there are only 7 letters: A, E, I, K, M, R, T, but the order of these letters in the alphabet is unknown. A word is defined as any sequence of seven different letters from the alphabet, and no other words exist in the language. The chief of the tribe listed all existing words in alphabetical order and noticed that the word "Metrika" has the number 3634 in this list. What is the number of the word "Materik" in this list? (20 points)
Solution: The total number of words in the tribe's language is $7!=5040$. Note that the number of words starting with any particular letter is the same for any first letter, which is $7!\div 7=6!=720$. If a word starts with the first letter in the alphabet, the numbering of any such word starts from number 1 and ends at number 6!. If it starts with the second letter in the alphabet, the numbering starts from number $6!+1$ and ends at number $2 \cdot 6$!, and so on. In general, if a word starts with the $k$-th letter in the alphabet, its numbering varies from number $(k-1) \cdot 6!+1$ to number $k \cdot 6$!. The number 3634 satisfies the inequality $5 \cdot 6$! $<3634 \leq 6 \cdot 6$!, so M is the sixth letter in the alphabet. Now, we will repeat a similar process for the remaining six letters. Specifically, we will forget about the existence of the first letter by removing it from the word. Then the word's number will decrease by $5 \cdot 6!=3600$. If we now form all six-letter words and arrange them in alphabetical order, the word "Etrika" would have the number 34. The number of words starting with any particular letter is the same for any first letter, which is $6!\div 6=$ $5!=120$. If the first letter of the word among the remaining six letters is the first in alphabetical order, the numbering of any such word starts from number 1 and ends at number 5!. If it is the second letter in alphabetical order among the remaining, the numbering starts from number $5!+1$ and ends at number $2 \cdot 5$!, and so on. In general, if the first letter of the word is the $k$-th letter in alphabetical order among the remaining, its numbering varies from number $(k-1) \cdot 5$! to number $k \cdot 5$!. The number 34 satisfies the inequality above, which implies $34 \leq 5$!, so E is the first in alphabetical order among the remaining, and thus the first letter of the alphabet. Continuing this similar process, we get the order of the letters: E - first, A - second, T - third, R - fourth, I - fifth, M - sixth, K - seventh.

In the word "Materik," the letters are in the following order: $6,2,3,1,4,5,7$, so its number is 5 . $6!+1 \cdot 5!+1 \cdot 4!+0 \cdot 3!+0 \cdot 2!+0 \cdot 1!+0 \cdot 0!+1=3745$. (The multiplier before $k!$ indicates the number of digits to the right and less than the digit in the ($k+1$)-th position, counting from the end of the word. A one is added at the end because the numbering of words starts with it.