Alice is bored in class, so she thinks of a positive integer. Every second after that, she subtracts from her current number its smallest prime divisor, possibly itself. After 2022 seconds, she realizes that her number is prime. Find the sum of all possible values of her initial number.
Solution
Let denote Alice's number after seconds, and let be the smallest prime divisor of . We are given that is prime, and want to find . If is even, then , since every is even. Then we need , so . If is odd, then is even, so by similar logic to the even case, . Then since and , we must have or 337. But if , so 337 is not the smallest prime divisor of . Thus, we need , so , which works. Thus, the final answer is .
Want a route through all this instead of an archive? The track
puts 2,000 problems in a working order, from AMC 10 level to the IMO shortlist.