Skip to main content

2021 AIME II Problem 9

Problem 9 of 15IntermediateNumber Theory

Find the number of ordered pairs (m,n)(m, n) such that mm and nn are positive integers in the set {1,2,…,30}\{1, 2, \ldots, 30\} and the greatest common divisor of 2m+12^m + 1 and 2n−12^n - 1 is not 1.1.

Your answer

Integer from 0 to 999
Show solution

Solution

Suppose an odd prime pp divides both 2m+12^m + 1 and 2n−1.2^n - 1. From 2m≡−1(modp),2^m \equiv -1 \pmod p, the order of 22 modulo pp divides 2m2m but not m,m, so the order contains exactly one more factor of 22 than mm does. The order also divides n,n, so nn must contain strictly more factors of 22 than m:m: writing v2v_2 for the number of factors of 2,2, we need v2(n)>v2(m).v_2(n) \gt v_2(m). Conversely, if v2(n)>v2(m),v_2(n) \gt v_2(m), let g=gcd⁡(m,n).g = \gcd(m, n). Then v2(g)=v2(m),v_2(g) = v_2(m), so mg\frac{m}{g} is odd and 2g+12^g + 1 divides 2m+1;2^m + 1; also 2g2g divides n,n, so 2g+12^g + 1 divides 22g−1,2^{2g} - 1, which in turn divides 2n−1.2^n - 1. Hence the gcd exceeds 11 exactly when v2(n)>v2(m).v_2(n) \gt v_2(m). Among 1,…,301, \ldots, 30 the counts of numbers with v2=0,1,2,3,4v_2 = 0, 1, 2, 3, 4 are 15,8,4,2,1.15, 8, 4, 2, 1. The number of pairs with v2(m)<v2(n)v_2(m) \lt v_2(n) is 15⋅15+8⋅7+4⋅3+2⋅1=225+56+12+2=295. \begin{aligned} &15 \cdot 15 + 8 \cdot 7 + 4 \cdot 3 + 2 \cdot 1 \\ &= 225 + 56 + 12 + 2 = 295. \end{aligned}
AoPS wiki

Tagged: multiplicative order · greatest common divisor · power of 2

More practice