2012 AIME II Problem 12

Below is the professionally curated solution for Problem 12 of the 2012 AIME II, from LIVE by Po-Shen Loh. You can also try the full timed exam, view all 2012 AIME II solutions, or check the answer key.

All of the real AMC 8, AMC 10, AMC 12, and AIME problems in our complete solution collection are used with official legal permission of the Mathematical Association of America (MAA).

Concepts:modular arithmeticChinese Remainder Theorem

Difficulty rating: 2920

12.

For a positive integer p,p, define the positive integer nn to be pp-safe if nn differs in absolute value by more than 22 from all multiples of p.p. For example, the set of 1010-safe numbers is {3,4,5,6,7,13,14,15,16,17,23,}.\{3, 4, 5, 6, 7, 13, 14, 15, 16, 17, 23, \ldots\}. Find the number of positive integers less than or equal to 10,00010{,}000 which are simultaneously 77-safe, 1111-safe, and 1313-safe.

Solution:

Being pp-safe depends only on nmodp:n \bmod p: it requires 3nmodpp3.3 \le n \bmod p \le p - 3. That allows 22 residues modulo 7,7, 66 residues modulo 11,11, and 88 residues modulo 13.13. Since 71113=1001,7 \cdot 11 \cdot 13 = 1001, the Chinese remainder theorem gives exactly 268=962 \cdot 6 \cdot 8 = 96 safe residues modulo 1001,1001, so each block of 10011001 consecutive integers contains 9696 safe numbers.

The integers 11 through 1001010010 form ten such blocks, containing 960960 safe numbers. It remains to discard the safe numbers among 10001,,10010.10001, \ldots, 10010. Their residues modulo 77 run 5,6,0,1,2,3,4,5,6,0,5, 6, 0, 1, 2, 3, 4, 5, 6, 0, so only 1000610006 and 1000710007 are 77-safe; both are also 1111-safe (residues 77 and 88) and 1313-safe (residues 99 and 1010).

Therefore the count is 9602=958.960 - 2 = 958.

← Problem 11Full ExamProblem 13

Problem 12 in Other Years