Some Basics for RMO Number Theory: Congruences

I. The congruence notation:

It often happens that for the purposes of a particular calculation, two numbers which differ by a multiple of some fixed number are equivalent, in the sense that they produce the same result. For example, the value of (-1)^{n} depends only on whether n is odd or even, so that two values of n which differ by a multiple of 2 give the same result. Or again, if we are concerned only with the last digit of a number, then for that purpose two numbers which differ by a multiple of 10 are effectively the same.

The congruence notation, introduced by Gauss, serves to express in a convenient form the fact that the two integers a and b differ by a multiple of a fixed natural number m. We say that a is congruent to b with respect to the modulus m, or in symbols,

a \equiv b {\pmod m}

The meaning of this, then, is simply that a-b is divisible by m. The notation facilitates calculations in which numbers differing by a multiple of m are effectively the same, by stressing the analogy between congruence and equality. Congruence, in fact, means “equality except for the addition of some multiple of m”.

A few examples of valid congruences are :

63 \equiv 0 {\pmod 3}; 7 \equiv -1 {\pmod 8}; 5^{2} \equiv -1 {\pmod {13}}

A congruence to the modulus 1 is always valid, whatever the two numbers may be, since every number is a multiple of 1. Two numbers are congruent with respect to the modulus 2 if they are of the same parity, that is, both even or both odd.

Two congruences can be added, subtracted or multiplied together, in just the same way as two equations, provided all the congruences have the same modulus. If

a \equiv \alpha {\pmod m} and b \equiv \beta {\pmod m}


a + b \equiv {\alpha + \beta} {\pmod m}

a - b \equiv {\alpha - \beta}{\pmod m}

ab \equiv {\alpha\beta} {\pmod m}

The first two of these statements are immediate: for example, (a+b) - (\alpha + \beta) is a multiple of m because a- \alpha and b - \beta are both multiples of m. The third is not quite so immediate because ab - \alpha \beta = (a-\alpha)b, and a - \alpha is a multiple of m. Next, ab \equiv \alpha \beta, for a similar reason. Hence, ab \equiv {\alpha \beta} {\pmod m}.

A congruence can always be multiplied throughout by any integer; if a \equiv {\alpha} {\pmod m} the10n ka \equiv {k\alpha} {\pmod m}. Indeed this is a special case of the third result above, where b and \beta are both k. But, it is not always legitimate to cancel a factor from a congruence. For example, 42 \equiv 12 {\pmod 10}, but it is not permissible to cancel the factor 6 from the numbers 42 and 12, since this would give the false result 7 \equiv 2 {\pmod 10}. The reason is obvious: the first congruence states that 42-12 is a multiple of 10, but this does not imply that \frac{1}{6}(42-12) is a multiple of 10. The cancellation of a factor from a congruence is legitimate if the factor is relatively prime to the modulus. For, let the given congruence be ax \equiv ay {\pmod m}, where is the factor to be cancelled, and we suppose that a is relatively prime to m. The congruence states that a(x-y) is divisible by m, and hence, (x-y) is divisible by m.

An illustration of the use of congruences is provided by the well-known rules for the divisibility of a number by 3 or 9 or 11. The usual representation of a number n by digits in the scale of 10 is really a representation of n in the form

n = a + 10b + 100c + \ldots

where a, b, c, … are the digits of the number, read from right to left, so that a is the number of units, b the number of tens, and so on. Since 10 \equiv 1 {\pmod 9}, we have also 10^{2} \equiv 1 {\pmod 9}, and 10^3 \equiv 1 {\pmod 9}, and so on. Hence, it follows from the above representation of n that

n \equiv {a+b+c+\ldots} {\pmod 9}

In other words, any number n differs from the sum of its digits by a multiple of 9, and in particular n is divisible by 9 if and only if the sum of its digits is divisible by 9. The same applies with 3 in place of 9 throughout.

The rule for 11 is based on the fact that 10 \equiv -1 {\pmod 11} so that 10^2 \equiv {+1} {\pmod 11}, and so on. Hence,

n \equiv {a-b+c- \ldots} {\pmod 11}

It follows that n is divisible by 11 if and only if a-b+c-\ldots is divisible by 11. For example, to test the divisibility of 958 by 11 we form 1-8+5-9, or -11. Since this is divisible by 11, so is 9581.

Ref: The Higher Arithmetic by H. Davenport, Eighth Edition, Cambridge University Press.


Nalin Pithwa.


Pre RMO (PRMO) practice questions, specially selected: PRMO 2018

The following set of problems tinkers, kindles some basic mathematical concepts as well as algebraic manipulations, so I suggest you try them out:

Try to decide by yourself which set of points are defined by these relations:

(a) |x| = |y|

(b) \frac{x}{|x|} = \frac{y}{|y|}

(c) |x| + x = |y| + y

(d) [x] = [y].

Note: The symbol [x] denotes the whole part of the number x, that is, the largest whole number not exceeding x. For example, [3.5] = 3, [5] = 5, [-2.5] = -3.

(e) x - [x] = y - [y]

(f) x - [x] > y - [y].

Good luck.

Nalin Pithwa.

Pre RMO August 2018: some practice problems selected

Question 1:

Can the product of 31256 and 8427 be 263395312? Give reasons (of course, brute force long calculation will not be counted as an answer ! :-)).

Solution 1:

Use the rule “casting out the nines”: a number divided by 9 will leave the same remainder as the sum of its digits divided by nine.

In this particular case, the sums of the digits of the multiplicand, multiplier, and product are 17, 21, and 34 respectively, again, the sums of the digits of these three numbers are 8, 3, and 7, hence, 8 times 3 is 24 and, which has 6 for the sum of the digits; thus, we have two different remainders, 6 and 7, and the multiplication is incorrect.

Question 2:

Prove that 4.41 is a square number in any scale of notation whose radix is greater than 4.

Solution 2:

Let r be the radix; then, 4.41 = 4 + \frac{4}{r} + \frac{1}{r^{2}}=(2 + \frac{1}{r})^{2};

thus, the given number is the square of 2.1

Question 3:

In what scale is the decimal number 2.4375 represented by 2.13?

Solution 3:

Let r be the radix; then, 2 + \frac{}{} + \frac{}{} = 2.4375= 2 \frac{7}{16}

hence, 7r^{2}-16r-48=0

that is, (7r+12)(r-4)=0.

Hence, the radix is 4.

More later,

Nalin Pithwa

Solution: Intel Pentium P5 floating point unit error (1994): RMO problem !!!

Finally, the much awaited solution is here:

(I re-state the problem from a previous blog, almost a month old):

Two number theorists bored in a chemistry lab, played a game with a large flask containing 2 litres of a colourful chemical solution and an ultra-accurate pipette. The game was that they would take turns to recall a prime number p such that (p+2) is also a prime number. Then, the first number theorist would pipette out 1/p litres of chemical and the second \frac{1}{p+2} litres. How many times do they have to play this game to empty the flask completely?


It is easy to play this game initially even for ordinary people : one could guess p to be 3 because 5 is a prime number, then 5 and 7, 11 and 13, 17 and 19, 29 and 31, and so on. These are called twin primes. Number theorists need to be there to recall large twin primes. The emptied amount of liquid in litres is given by the twin prime harmonic series H_{P}^{TP}:

H_{P}^{TP} = (\frac{1}{3} + \frac{1}{5}) + (\frac{1}{5} + \frac{1}{7}) + (\frac{1}{11} + \frac{1}{13}) + (\frac{1}{17}+\frac{1}{19}) + \ldots

This series is known to converge to 1.902160583104…which is known as Brun’s constant, named after Viggo Brun, who proved it in 1919. It is a curious result because it is not known if infinitely many twin primes exist, refer for example,

even though it is known that infinitely many primes exist (a result proved by Euclid in 300 BC!) and the harmonic series diverges (a result proved by Euler in the eighteenth century). Had the series H_{P}^{TP} diverged, then one could say that infinite twin primes exist. But, as the series converges (must converge with finitely many twin primes or may converge even with infinitely many twin primes), the question of infinitude of twin primes is still an open one. (there is a recent famous result of Prof. Yitang Zhang also regarding this). Anyway, the point is that the two number theorists would not be able to empty 2 litres even if they play the game for infinitely long period. So, they are not bored and can keep themselves busy in the chemistry lab forever.

Another curious fact about Brun’s constant is that its computation in a computer revealed a floating point division arithmetic error in Intel’s Pentium P5 Floating Point Unit in 1994. This bug was discovered by Thomas Nicely while evaluating the reciprocals of twin primes 824633702441 and 824633702443. Consequently, Intel incurred USD 475 million to fix this bug. For a while in 1995, number theory and Brun’s constant took the centre stage in popular media.

For curious minds, there also exist prime triplets, prime quadruples etc. If four number theorists play the game, they will not be able to empty even 1 litre because the harmonic series of prime quadruples is estimated to be around 0.8705883800.


Popular Problems and Puzzles in Mathematics, Asok Kumar Mallik, IISc Press, Foundation Books:

Amazon India link:

AMS Menger Awards 2018

(shared from the AMS website for motivational purposes)

The AMS presented the Karl Menger Memorial Awards at the 2018 Intel International Science and Engineering Fair (Intel ISEF), May 13-18, 2018 in Pittsburgh, PA. The First Place Award of US$2000 was given to Ryusei Sakai, Sota Kojima, and Yuta Yokohama, Shiga Prefectural Hikone Higashi High School, Japan, for “Extension of Soddy’s Hexlet: Number of Spheres Generated by Nested Hexlets.” [Photo: bottom row (left to right): Dr. Keith Conrad (committee chair), Rachana Madhukara, Yuta Yokohama, Sota Kojima, Ryusei Sakai; top row (left to right): Chavdar Lalov, Gianfranco Cortes-Arroyo, Gopal Goel, Savelii Novikov, Boris Baranov. Not pictured: Muhammad Abdulla. Photo by the Society for Science & the Public.]
The Menger Awards Committee also presented the following awards:

  • Second Award of $1,000: Gopal Krishna Goel (Krishna Homeschool, OR), “Discrete Derivatives of Random Matrix Models and the Gaussian Free Field” and Rachana Madhukara, Canyon Crest Academy, CA, “Asymptotics of Character Sums”
  • Third Award of $500: Chavdar Tsvetanov Lalov, Geo Milev High School of Mathematics, Bulgaria, “Generating Functions of the Free Generators of Some Submagmas of the Free Omega Magma and Planar Trees”; Gianfranco Cortes-Arroyo, West Port High School, FL, Generalized Persistence Parameters for Analyzing Stratified Pseudomanifolds”; Muhammad Ugur Oglu Abdulla, West Shore Junior/Senior High School, FL, “A Fine Classification of Second Minimal Odd Orbits”; Boris Borisovich Baranov and Savelii Novikov, School 564, St. Petersburg, Russian Federation, “On Two Letter Identities in Lie Rings”
  • Certificate of Honorable Mention: Dmitrii Mikhailovskii, School 564, St. Petersburg, Russian Federation, “New Explicit Solution to the N-Queens Problem and the Millennium Problem”; Chi-Lung Chiang and Kai Wang, The Affiliated Senior High School of National Taiwan Normal University, Chinese Taipei, “’Equal Powers Turn Out’ – Conics, Quadrics, and Beyond”; Kayson Taka Hansen, Twin Falls High School, ID, “From Lucas Sequences to Lucas Groups”; Gustavo Xavier Santiago-Reyes and Omar Alejandro Santiago-Reyes, Escuela Secundaria Especializada en Ciencias, Matematicas y Tecnología, Puerto Rico, “Mathematics of Gene Regulation: Control Theory for Ternary Monomial Dynamical Systems”; Karthik Yegnesh, Methacton High School, PA, “Braid Groups on Triangulated Surfaces and Singular Homology”

A booklet on Karl Menger was also given to each winner. This is the 28th year of the presentation of the Karl Menger Memorial Awards. The Society’s participation in the Intel ISEF is supported in part by income from the Karl Menger Fund, which was established by the family of the late Karl Menger. For more information about this program or to make contributions to this fund, contact the AMS Development Office.

Cheers to the winners,

Nalin Pithwa.