QlarIITy

MathematicsJEE Main 2026 · 21 JanuaryInteger

LetS={(m,n):m,n∈{1,2,3,…,50}}S = \{(m, n) : m, n \in \{1, 2, 3, \ldots, 50\}\}. If the number of elements (m,n)(m, n) in SS such that 6m+9n6^m + 9^n is a multiple of 55 is pp and the number of elements (m,n)(m, n) in SS such that m+nm + n is a square of a prime number is qq, then p+qp + q is equal to ______.

Try it before you look.The full solution is on this page, below the answer box, the moment you check. No sign-in needed.

Solution

Core idea. Reducing the bases modulo five turns each power into a fixed or alternating remainder.

Concept refresher. If a≡b (mod k)a \equiv b \ (\text{mod } k), then an≡bn (mod k)a^n \equiv b^n \ (\text{mod } k) for every natural nn, and remainders add: a+c≡b+d (mod k)a + c \equiv b + d \ (\text{mod } k) when c≡dc \equiv d. The number of ordered pairs (m,n)(m, n) of natural numbers with

m+n=s, 1≤m,n≤Nm + n = s, \ 1 \leq m, n \leq N

is s−1s - 1 when 2≤s≤N+12 \leq s \leq N + 1.

Approach. Reduce 6m6^m and 9n9^n modulo 55 to find pp; list the squares of primes up to 100100, count the ordered pairs for each, and add.

  1. Step 1: Remainders of the powers

    Since 6≡16 \equiv 1 and 9≡−1 (mod 5)9 \equiv -1 \ (\text{mod } 5),

    6m+9n≡1+(−1)n (mod 5)6^m + 9^n \equiv 1 + (-1)^n \ (\text{mod } 5)

    which is 00 when nn is odd and 22 when nn is even.

  2. Step 2: Count p

    Any mm works with an odd nn. There are 5050 choices of mm and 2525 odd values of nn from 11 to 4949:

    p=50⋅25=1250p = 50 \cdot 25 = 1250
  3. Step 3: Possible prime squares for q

    Since 2≤m+n≤1002 \leq m + n \leq 100, the sum can be 22=42^2 = 4, 32=93^2 = 9, 52=255^2 = 25 or 72=497^2 = 49; the next, 112=12111^2 = 121, is too large. Each of these is at most 5151, so m+n=sm + n = s has s−1s - 1 ordered pairs:

    q=3+8+24+48=83q = 3 + 8 + 24 + 48 = 83
  4. Step 4: Add

    Adding the two counts gives the required value:

    p+q=1250+83=1333p + q = 1250 + 83 = 1333

Answer. 1333

Sanity check. For m+n=49m + n = 49 the pairs run from (1,48)(1, 48) to (48,1)(48, 1), all inside {1,…,50}\{1, \ldots, 50\}, which is 4848 pairs; and 6+9=156 + 9 = 15 is a multiple of 55 with n=1n = 1 odd, while 6+81=876 + 81 = 87 is not, with n=2n = 2 even.

Common wrong answers

  • 2583: Taking 9n≡4 (mod 5)9^n \equiv 4 \ (\text{mod } 5) for every nn makes 6m+9n≡06^m + 9^n \equiv 0 always, so p=2500p = 2500 and p+q=2583p + q = 2583; but 9n≡(−1)n9^n \equiv (-1)^n, which is 44 only for odd nn, so p=1250p = 1250.
  • 1330: Leaving out the sum 4=224 = 2^2 drops its 33 pairs, so q=80q = 80 and p+q=1330p + q = 1330; 22 is a prime, so m+n=4m + n = 4 counts.
  • 1292: Counting unordered pairs gives q=2+4+12+24=42q = 2 + 4 + 12 + 24 = 42 and 12921292; the elements of SS are ordered pairs, so (1,3)(1, 3) and (3,1)(3, 1) are different, and q=83q = 83.

Key takeaway

The trap. Reading nine as four modulo five for every power, which makes every pair work.

How toppers think. They list the few prime squares that fit the range of the sum before counting anything.

Remember. m+n=sm + n = s with 1≤m,n≤N1 \leq m, n \leq N has s−1s - 1 ordered solutions when s≤N+1s \leq N + 1.

More on Fundamental Principle of Counting