Skip to main content
OlympiadHQ

Browse · MathNet

Print

China Girls' Mathematical Olympiad

China counting and probability

Problem

Let and be two coprime positive integers, and let be a nonnegative integer. Determine the number of integers that can be written in the form , where and are nonnegative integers with . (posed by Li Weigu)
Solution
Define a set Let , where denotes the number of elements in set . The answer of the problem is where .

Now we establish the equation . Without loss of generality, we assume that . It is easy to see that satisfying equation . Note that Note also that with Hence number belongs to both sets and if and only if , or . Therefore, It implies that If , we conclude that In particular, . If , we conclude that
Final answer
Let r = max{p, q}. The number is s_n = ((n+1)(n+2))/2 for n < r, and s_n = (r(2n - r + 3))/2 for n ≥ r.

Techniques

Recursion, bijectionTelescoping series