Skip to main content
OlympiadHQ

Browse · MathNet

Print

Baltic Way 2023 Shortlist

Baltic Way 2023 number theory

Problem

In the land of Flensburg there is a single, infinitely long, street with houses numbered The police in Flensburg is trying to catch a thief which every day moves from the house where he is currently hiding to one of its neighbouring houses. To taunt the local law enforcement the thief reveals every day the highest prime divisor of the house he will move to. Every Sunday the police are allowed to search a single house, and they catch the thief if they search the house he is currently occupying. Determine if the thief will be able to escape the police indefinitely or if the police has a strategy to catch the thief in finite time.
Solution
We will prove that the police are always able to catch the thief in finite time. Let denote the house the thief stays at the -th night and denote the greatest prime divisor of . The police know that he stays at different neighbouring houses every night, so for all non-negative integers . Let us assume that the police are given the address of the thief's first two hiding spots, then we will prove by induction that the police can determine precisely except being unable to distinguish between houses numbered and .

Assume the police knows and , then they know that or . In the first case they will receive and in the latter case they will receive as the biggest prime divisor of . Assume that they are unable to distinguish between these two cases, i.e., that , which implies since implies . Moreover, since are the biggest prime divisors of and they must both be powers of . However, the only powers of two with a difference of exactly are and . Hence , i.e. .

Thus, either the police will with certainty be able to determine or , in which case may equal either or . To complete the inductive step we observe that the police are always able to determine the parity of , since it changes every day. Thus, in the future if the police know that , then they can either determine or . However, the only way for the thief to leave the interval is to go to house number , in which case the police will be alerted by receiving , and they can again with certainty determine and preserving our inductive hypothesis.

To summarize, if the police knows both and , then they can always determine with certainty until . After this point they will have known the two last hiding places of the thief if he leaves the interval , restoring the inductive hypothesis, or otherwise, if he never leaves be able to determine his position, up to confusion about and using the parity of the day.

Now, to catch the thief in finite time, they may methodically try to guess all viable pairs of , i.e. and , of which there are countably many. For each viable starting position, let us consider either the immediate Sunday or the one after that, since each week has an odd amount of days, we are certain that exactly one of these days gives us that the thief is hiding in an odd house (given our assumption on his starting position). Thus, due to our inductive hypothesis, we can precisely determine where the thief will be, and search this house. If the thief is hiding in that house, the police wins, and if not, they will with certainty know that their guess of starting positions was incorrect, and move onto the next guess. By the above argument, each guess of initial starting positions requires at most two weeks, meaning that the police will catch the thief in finite time.

Techniques

Prime numbersGreatest common divisors (gcd)AlgorithmsLogicInduction / smoothing