Skip to main content

2023 AIME II Problem 15

Problem 15 of 15HarderNumber TheoryArithmetic

For each positive integer nn let ana_n be the least positive integer multiple of 2323 such that an≡1(mod2n).a_n \equiv 1 \pmod{2^n}. Find the number of positive integers nn less than or equal to 10001000 that satisfy an=an+1.a_n = a_{n+1}.

Your answer

Integer from 0 to 999
Show solution

Solution

Write an=23bn,a_n = 23 b_n, where bnb_n is the unique integer in [1,2n][1, 2^n] with 23bn≡1(mod2n),23 b_n \equiv 1 \pmod{2^n}, i.e. the inverse of 2323 mod 2n.2^n. Reducing mod 2n2^n shows bn+1∈{bn, bn+2n},b_{n+1} \in \{b_n,\ b_n + 2^n\}, so an=an+1a_n = a_{n+1} exactly when bn+1=bn,b_{n+1} = b_n, which happens exactly when the binary digit of weight 2n2^n in bn+1b_{n+1} is 0.0. Since 23⋅89=2047=211−1,23 \cdot 89 = 2047 = 2^{11} - 1, setting Tk=1+211+222T_k = 1 + 2^{11} + 2^{22} +⋯+211(k−1){}+ \cdots + 2^{11(k-1)} gives 23⋅89 Tk=211k−1,23 \cdot 89\,T_k = 2^{11k} - 1, so 23(211k−89 Tk)≡1(mod211k), \begin{gathered} 23\left(2^{11k} - 89\,T_k\right) \\ \equiv 1 \pmod{2^{11k}}, \end{gathered} and every bnb_n with n≤11kn \le 11k is the reduction of 211k−89 Tk2^{11k} - 89\,T_k mod 2n.2^n. In binary, 89=1011001289 = 1011001_2 occupies positions 0,3,4,60, 3, 4, 6 of each 1111-bit block of 89 Tk.89\,T_k. Since 89 Tk89\,T_k is odd, 211k−89 Tk2^{11k} - 89\,T_k =(211k−1−89 Tk)+1= \bigl(2^{11k} - 1 - 89\,T_k\bigr) + 1 keeps digit 00 equal to 11 and complements every digit in positions 11 through 11k−1.11k - 1. So for n≥1,n \ge 1, the digit of weight 2n2^n is 00 exactly when n≡0,3,4,6(mod11).n \equiv 0, 3, 4, 6 \pmod{11}. Among 1≤n≤1000=90⋅11+10,1 \le n \le 1000 = 90 \cdot 11 + 10, the residue 00 occurs 9090 times and the residues 3,3, 4,4, 66 occur 9191 times each, for a total of 90+3⋅91=363.90 + 3 \cdot 91 = 363.
AoPS wiki

Tagged: modular arithmetic · number base · multiplicative order

More practice