Lambdia

2519, and the Shift That Turns Nine Congruences Into One

Every one of the nine conditions leaves a remainder one short of its divisor, so x plus one is divisible by all of 2 through 10 and the answer is 2519. Minimality comes free, and the whole solution set is 2520k minus 1. The article carries the coprimality caveat, the near miss 209 that satisfies six of the nine, and a variant where no shift exists.

Find the smallest positive whole number that leaves remainder 1 when divided by 2, remainder 2 when divided by 3, remainder 3 when divided by 4, and so on all the way to remainder 9 when divided by 10.

Nine conditions, and every one of them is a genuine constraint. Written out as a system of congruences the problem looks like an afternoon of work, and the standard tool for such systems does not even apply here. The answer is 2519, and there is a route to it that fits on one line.

Read the nine lines before solving them

The nine conditions are

x1(mod2),x2(mod3),x3(mod4),,x9(mod10)x \equiv 1 \pmod 2,\quad x \equiv 2 \pmod 3,\quad x \equiv 3 \pmod 4,\quad \dots,\quad x \equiv 9 \pmod{10}
(1)

and they all say the same thing. In each line the remainder is one less than the divisor. A number that leaves remainder 9 on division by 10 is one short of a multiple of 10. A number that leaves remainder 3 on division by 4 is one short of a multiple of 4. So add one to xx and every line collapses.

xd1(modd)x+10(modd)x \equiv d - 1 \pmod d \quad\Longleftrightarrow\quad x + 1 \equiv 0 \pmod d
(2)
Fig. 1 — The same nine facts on both sides. Nothing was solved here, only rewritten, and the rewriting is the whole solution.

Nine separate congruences have become one sentence: x+1x + 1 is divisible by every integer from 2 to 10. The nine unknown remainders are gone, and so is any need to combine anything.

The smallest such shift

A number divisible by all of 2,3,,102, 3, \dots, 10 is a common multiple of them, and the smallest positive one is by definition their least common multiple. To build it, take the highest power of each prime that appears anywhere in the list. The 8 in the list forces 232^3 and the 9 forces 323^2:

lcm(2,3,,10)=233257=2520\operatorname{lcm}(2,3,\dots,10) = 2^3 \cdot 3^2 \cdot 5 \cdot 7 = 2520
(3)
Fig. 2 — Why 2520 and not 210. The exponents are doing real work, and forgetting them is the most common way to get this step wrong.
x=25201=2519x = 2520 - 1 = 2519
(4)

And minimality comes free. The smallest positive xx corresponds to the smallest positive value of x+1x + 1, which is the least common multiple by definition. No separate argument is needed, which is another way of saying that the shift did not just find a solution, it found the solution set.

The full solution set

The multiples of 2520 are exactly the common multiples of 2,3,,102, 3, \dots, 10, so the integers satisfying all nine conditions are precisely x=2520k1x = 2520k - 1 for k=1,2,3,k = 1, 2, 3, \dots. The first three are 2519, 5039 and 7559, and there are 396 of them below one million.

The slow route works, which is why it is dangerous

Nothing above is a proof that grinding out the nine congruences fails. It does not fail. Merge them two at a time in any order and you arrive at x2519(mod2520)x \equiv 2519 \pmod{2520}, correctly. It takes a few minutes rather than a few seconds, and it takes care, because the moduli are not pairwise coprime and merging in that setting has a condition on it.

The Chinese remainder theorem in its usual form asks for pairwise coprime moduli, and 2,3,,102, 3, \dots, 10 are anything but: 2 divides 4, 6, 8 and 10, and 3 divides 6 and 9. Two congruences xa(modm)x \equiv a \pmod{m} and xb(modn)x \equiv b \pmod{n} with a shared factor are solvable exactly when

ab(modgcd(m,n))a \equiv b \pmod{\gcd(m,n)}
(5)

and when they are, the merged modulus is lcm(m,n)\operatorname{lcm}(m,n) rather than mnmn. Here condition (5) holds at every step, which is not luck: all nine congruences are shadows of the single statement 2520x+12520 \mid x+1, so they cannot contradict each other. Redundancy is the reason the system is easy and also the reason it looks hard.

The tempting wrong number

The near miss to know about is 209. It comes from multiplying the primes below 11 and forgetting the powers: 2357=2102 \cdot 3 \cdot 5 \cdot 7 = 210, so 209209. It is a good near miss because it satisfies six of the nine conditions, all the ones whose divisor is squarefree. It fails at 4, 8 and 9. Checking the first one is enough: 209=524+1209 = 52 \cdot 4 + 1, so it leaves remainder 1 where 3 was required.

The same problem with different lists

The structure survives any upper limit. Asking for remainders 1,2,,n11, 2, \dots, n-1 against divisors 2,3,,n2, 3, \dots, n gives x=lcm(2,,n)1x = \operatorname{lcm}(2,\dots,n) - 1. Extending our list by one more line, up to remainder 10 on division by 11, gives lcm(2,,11)=27720\operatorname{lcm}(2,\dots,11) = 27720 and so x=27719x = 27719. These least common multiples grow fast, roughly like ene^{n}, because every new prime multiplies the answer. Running the list to 20 gives lcm(2,,20)=232,792,560\operatorname{lcm}(2,\dots,20) = 232{,}792{,}560, so the same puzzle phrased with nineteen conditions has an answer just under a quarter of a billion, and it is still one subtraction away.

The word "positive" in the question is also doing something. Take k=0k = 0 in the solution set and you get x=1x = -1, which satisfies all nine conditions perfectly well in the integers: dividing 1-1 by 4 gives quotient 1-1 and remainder 3, as required, and the same happens at every divisor. So 1-1 is the real centre of this problem, and 2519 is only the first solution that happens to be positive. Seeing that is another way of noticing the shift: the whole solution set is the multiples of 2520, moved back by one.

The shift also works whenever the remainders are a constant amount below their divisors, not only one. If every condition read "remainder d3d - 3 on division by dd", then x+3x + 3 is the common multiple and x=25203=2517x = 2520 - 3 = 2517, valid as long as each remainder stays non-negative, which here means d3d \ge 3.

Where the trick stops

Change one remainder and the structure is gone. Ask for remainder 1 on division by 2, remainder 2 on division by 3, and then remainder 2 on division by 4, and no shift lines the conditions up, because the offsets are now 1, 1 and 2. Worse, that particular system has no solution at all: remainder 2 modulo 4 forces xx even, while remainder 1 modulo 2 forces it odd. Condition (5) is what detects this, with gcd(2,4)=2\gcd(2,4) = 2 and 1≢2(mod2)1 \not\equiv 2 \pmod 2.

That is the real lesson of the problem. The elegant route exists because the nine lines are one line in disguise, and the first thing to do with a wall of congruences is to look for the disguise. When there is not one, the grind is what you have, and the coprimality caveat is what keeps it honest.

Sources and further reading

The answer and its minimality were both checked by exhaustive search over every integer up to 20,000, since no identity can establish minimality on its own. The pairwise merge was also run in both directions and returns 2519 modulo 2520, so the slow route is verified to work rather than merely assumed to.

Comments · 0

Be the first to comment.