9.5. In a row from left to right, there are $n$ coins. It is known that two of them are counterfeit, they lie next to each other, the left one weighs 9 grams, the right one 11 grams, and all the remaining ones are genuine and each weighs 10 grams. The coins are weighed on balance scales, which either show which of the two pans is heavier, or are in equilibrium, indicating that the weights on both pans are the same. For what maximum $n$ can the coin weighing 11 grams be found in three weighings?
Answer. $n=28$.

Solution. Let $n=28$. Divide all 28 coins into three piles: the first pile contains coins numbered $11,13,15,17,19,21,23,25,27$, the second pile contains coins numbered $12,14,16,18,20,22,24,26,28$, and the third pile contains coins numbered from 1 to 10. The first weighing compares the first and second piles. Note that if the scales are not in balance, the heavy coin is in the heavier pile. Indeed, if the numbers of both fake coins are greater than 10, then the light one will fall into one of the two weighed piles, and the heavy one will fall into the other, causing the heavier pile to tip. If the numbers of both fake coins are not greater than 10, then both will fall into the third pile, and the scales will remain in balance. If the numbers of the fake coins are 10 and 11, the heavy one will fall into the first pile, and the second will consist entirely of genuine coins, causing the first pile to tip. It is important to note that if a similar division is made from the beginning of the numbers rather than the end, it is incorrect when the fake coins are in the 18th and 19th positions. If the scales are in balance, then the heavy and light coins are in the third pile of 10 coins. In this "worst" case, we divide the third pile similarly into three: the first pile contains numbers $6,8,10$, the second pile contains numbers $5,7,9$, and the third pile contains numbers $1,2,3,4$. The second weighing compares the first and second piles to determine which of the three piles contains the heavy coin. If balance is again achieved and it is together with the light one in the third pile of 4 coins, we compare coins 3 and 4. If they are equal, the heavy one is the 2nd; if one is heavier, that one is the heavy one. The same applies if the heavy one is in the pile of 3 coins - we compare the second and third, the heavier one is the heavy one.

If the heavy coin is found, for example, in the first pile during the first weighing, we divide it into three groups of three: the first pile contains coins $19,23,27$, the second pile contains coins $17,21,25$, and the third pile contains coins $11,13,15$. We weigh the first and second piles to find the pile of three coins containing the heavy one. The final weighing of the second and third coins in this pile identifies the desired one. Similarly, if the heavy coin is found in the second pile during the first weighing. Note that the light coin participates in the third weighing if and only if the first two weighings result in balance.

If there are more than 28 coins, the number of possible positions for the heavy coin will be more than $27=3^3$, which is greater than the number of possible outcomes of three weighings, equal to 3.3.3. Therefore, it is impossible to uniquely associate the number of the heavy coin with a specific outcome of three weighings and find it.

Grading criteria. Algorithm for finding the heavy coin when $n=28$: 5 points ($\cdot$) If similar divisions as indicated in the author's solution are made but from the beginning of the numbers, and the rest is the same: deduct 2 points. ($\cdot$) If the correct division is made but there is no clear explanation that if the scales are not in balance during the first weighing, the heavy coin is in the heavier pile: deduct 1 point. ( $($ )

Proof that the heavy coin cannot be found with certainty in three weighings when $n>28$: 2 points.