Maths Olympiad Prep

Library / All-Soviet-Union Mathematical Olympiad /160 of 185

All-Soviet-Union Mathematical Olympiad

Number theory Difficulty 6.2 National Olympiad Prove it Soviet Union

Problem:

Given two relatively prime natural numbers rr and ss, call an integer good if it can be represented as mr+nsmr + ns with m,nm, n non-negative integers and bad otherwise. Prove that we can find an integer cc, such that just one of kk, c−kc - k is good for any kk. How many bad numbers are there?

Solution

Solution:

Notice that 00 is good and all negative numbers are bad. Take c=rs−r−sc = rs - r - s. First, cc is bad. For suppose otherwise: c=mr+nsc = mr + ns. Then mr+ns=(s−1)r−smr + ns = (s - 1)r - s. Hence (s−1−m)r=(n+1)s(s - 1 - m)r = (n + 1)s, so rr divides n+1n + 1. Say n+1=krn + 1 = kr, and then s−1−m=kss - 1 - m = ks, so m=(1−k)s−1m = (1 - k)s - 1. But n+1n + 1 is positive, so k≥1k \geq 1, and hence mm is negative. Contradiction.

If kk is good, then c−kc - k must be bad (otherwise cc would be good). Suppose kk is bad. Since rr and ss are relatively prime we can find integers aa and bb with ar+bs=1ar + bs = 1 and hence integers mm and nn with mr+ns=kmr + ns = k. Adding a multiple of sr−rssr - rs to both sides if necessary, this gives a pair m,nm, n with mr+ns=kmr + ns = k and mm non-negative. Now take the pair with the smallest possible nonnegative mm. Then m≤s−1m \leq s - 1 (for otherwise m′=m−sm' = m - s, n′=n+rn' = n + r would be a pair with smaller non-negative mm). Also n≤−1n \leq -1, otherwise kk would be good. Now c−k=(s−1−m)r+(−n−1)sc - k = (s - 1 - m)r + (-n - 1)s and the coefficients s−1−ms - 1 - m and −n−1-n - 1 are both non-negative, so c−kc - k is good.

So exactly (rs−r−s+1)/2(rs - r - s + 1)/2 integers are bad.

Want a route through all this instead of an archive? The track puts 2,604 problems in a working order, from Junior Challenge level to the IMO shortlist.

Source: MathNet, licensed CC-BY-4.0. Statement reproduced verbatim; metadata (topic, difficulty) added by this project.