Maths Olympiad Prep

Library / /212 of 348

Number theory Difficulty 5.0 AIME Find the answer

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.

A number or a short expression. Spacing and $ signs are ignored.

Solution

Let aka_{k} denote Alice's number after kk seconds, and let pkp_{k} be the smallest prime divisor of aka_{k}. We are given that a2022a_{2022} is prime, and want to find a0a_{0}. If a0a_{0} is even, then an+1=an2a_{n+1}=a_{n}-2, since every ana_{n} is even. Then we need a2022=2a_{2022}=2, so a0=4046a_{0}=4046. If a0a_{0} is odd, then a1=a0p0a_{1}=a_{0}-p_{0} is even, so by similar logic to the even case, a1=4044a_{1}=4044. Then since p0a0p0p_{0} \mid a_{0}-p_{0} and 4044=433374044=4 \cdot 3 \cdot 337, we must have p0=3p_{0}=3 or 337. But if p0=337,a0=12337+337=13337p_{0}=337, a_{0}=12 \cdot 337+337=13 \cdot 337, so 337 is not the smallest prime divisor of a0a_{0}. Thus, we need p0=3p_{0}=3, so a0=4047a_{0}=4047, which works. Thus, the final answer is 4046+4047=80934046+4047=8093.

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.

Source: Omni-MATH, licensed Apache-2.0. Statement and solution reproduced as published; topic and difficulty added by this site.