Let S = \(m, n) : m, n \1, 2, 3, , 50\\. If the number of elements (m, n) in S such that 6m + 9n is a multiple of 5 is p and the number of elements (m, n) in S such that m + n is a square of a prime number is q, then p + q is equal to .
Answer
1333
Solution
Unit digit of 6m is always 6.
Unit digit of 9n is 9 (n odd) or 1 (n even).
6m + 9n ends in 6 + 9 = 15 5 (multiple of 5) when n is odd, and in 7 when n is even.
p = 50 25 = 1250 (any m, odd n)
For q: 2 m + n 100; squares of primes in this range: 4, 9, 25, 49 (112 = 121 > 100)
For s 51, the number of pairs with m + n = s is s - 1:
q = 3 + 8 + 24 + 48 = 83
p + q = 1250 + 83 = 1333
Answer: 1333