7. (40 points) A cat caught 81 mice and arranged them in a circle, numbering them from $1 \sim 81$ in a clockwise direction. The cat starts counting from a certain mouse in a clockwise direction, continuously counting “$1, 2, 3$” and eating all the mice that are counted as 3. As the cat continues to count, the circle gets smaller and smaller until only two mice are left. It is known that one of the remaining mice with a higher number is 40. Question: From which numbered mouse did the cat start counting?
7. First, arrange the numbers of all the mice in 9 columns as follows.
\begin{tabular}{ccccccccc}
1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 \\
10 & 11 & 12 & 13 & 14 & 15 & 16 & 17 & 18 \\
19 & 20 & 21 & 22 & 23 & 24 & 25 & 26 & 27 \\
28 & 29 & 30 & 31 & 32 & 33 & 34 & 35 & 36 \\
37 & 38 & 39 & 40 & 41 & 42 & 43 & 44 & 45 \\
46 & 47 & 48 & 49 & 50 & 51 & 52 & 53 & 54 \\
55 & 56 & 57 & 58 & 59 & 60 & 61 & 62 & 63 \\
64 & 65 & 66 & 67 & 68 & 69 & 70 & 71 & 72 \\
73 & 74 & 75 & 76 & 77 & 78 & 79 & 80 & 81
\end{tabular}

Assuming the cat starts counting from mouse number 1. In the first round, the mice in columns 3, 6, and 9 are eaten. In the second round, the mice in columns 4 and 8 are eaten. The remaining mice's numbers are rearranged into 9 columns as follows:
\begin{tabular}{ccccccccc}
1 & 2 & 5 & 7 & 10 & 11 & 14 & 16 & 19 \\
20 & 23 & 25 & 28 & 29 & 32 & 34 & 37 & 38 \\
41 & 43 & 46 & 47 & 50 & 52 & 55 & 56 & 59 \\
61 & 64 & 65 & 68 & 70 & 73 & 74 & 77 & 79
\end{tabular}

After the third and fourth rounds, the 3rd, 4th, 6th, 8th, and 9th columns in the rearranged 9 columns are eaten. At this point, the 16 surviving mice's numbers are:
\begin{tabular}{cccccccc}
1 & 2 & 10 & 14 & 20 & 23 & 29 & 34 \\
41 & 43 & 50 & 55 & 61 & 64 & 70 & 74
\end{tabular}

Continuing until only two mice remain, their numbers are 1 and 34. Given that the larger number is 40, the cat must have started counting from \(1 + 40 - 34 = 7\).