What is the kind of concentration required for RMO INMO IMO and IITJEE Advanced Mathematics?

Laser like concentration is a pre-requisite to genuinely creative work in math, computer science, or any other field, like chess and music. Let me illustrate a story of John Nash Jr. (Nobel Laureate, Economics, Abel Laureate genius mathematician): (Reference: A Beautiful Mind by Sylvia Nasar, Chapter 5 Genius):

KAI LAI CHUNG, a mathematics instructor who had survived the horrors of the Japanese conquest of his native China, was surprised to see the door of the Professors’ Room standing ajar.  It was usually locked. Kai Lai liked to stop by on the rare occasions when it was open and nobody was about. It had the feel of an empty church, no longer imposing and intimidating as it was in the afternoons when it was crowded with mathematical luminaries, but simply a beautiful sanctuary.

The light in the west common room filtered through thick stained-glass windows inlaid with formulae: Newton’s law of gravity, Einstein’s theory of relativity, Heisenberg’s uncertainty principle of quantum mechanics. At the far end, like an altar, was a massive stone fireplace. On one side was a carving of a fly confronting
the paradox of the MObius band. MObius had given a strip of paper a half twist and connected the ends, creating a seemingly impossible object: a surface with only one side. Kai Lai especially liked to read the whimsical inscription over the fire-place, Einstein’s expression of faith in science, “Der Herr Gott ist raffiniert aber Boshaft ist Er nicht,” which he took to mean that “the Lord is subtle but not malicious.”

On this particular fall morning, as he reached the threshold of the half-open door, Kai Lai stopped abruptly. A few feet away, on the massive table that dominated the room, floating among a sea of papers, sprawled a beautiful dark-haired young man. He lay on his back staring up at the ceiling as if he were outside on a lawn under an elm looking up at the sky through the leaves, perfectly relaxed, motionless, obviously lost in thought, arms folded behind his head. He was whistling softly. Kai Lai recognized the distinctive profile immediately. It was the new graduate student from West Virginia. A trifle shocked and a little embarrassed,
Kai Lai backed away from the door and hurried away before Nash could see or hear him.


Nalin Pithwa

Prof. Tim Gowers’ on functions, domains, etc.


Thanks a lot Prof. Gowers! Math should be sans ambiguities as far as possible…!

I hope my students and readers can appreciate the details in this blog article of Prof. Gowers.

Nalin Pithwa

Fermat-Kraitchik Factorization Method for factoring large numbers: training for RMO

Reference: Elementary Number Theory, David M. Burton, 6th Edition.

In a fragment of a letter in all probability to Father Marin Mersenne in 1643, Fermat described a technique of his for factoring large numbers. This represented the first real improvement over the classical method of attempting to find a factor of n by dividing by all primes not exceeding \sqrt{n}. Fermat’s factorization scheme has at its heart the observation that the search for factors of an odd integer n (because powers of 2 are easily recognizable and may be removed at the outset, there is no loss in assuming that n is odd) is equivalent to obtaining integral solutions of x and y of the equation n = x^{2} - y^{2}.

If n is the difference of two squares, then it is apparent that n can be factored as n = x^{2}-y^{2} = (x+y)(x-y).

Conversely, when n has the factorization n=ab, with a \geq b \geq 1, then we may write n = (\frac{a+b}{2})^{2}-(\frac{a-b}{2})^{2}

Moreover, because n is taken to be an odd integer, a and b are themselves odd, hence, \frac{a+b}{2} and \frac{a-b}{2} will be nonnegative integers.

One begins the search for possible x and y satisfying the equation n=x^{2}-y^{2} or what is the same thing, the equation x^{2}-n=y^{2} by first determining the smallest integer k for which k^{2} \geq n. Now, look successively at the numbers k^{2}-n, (k+1)^{2}-n, (k+2)^{2}-n, (k+3)^{2}-n, \ldots until a value of m \geq n is found making m^{2}-n a square. The process cannot go on indefinitely, because we eventually arrive at (\frac{n+1}{2})^{2}-n=(\frac{n-1}{2})^{2} the representation of n corresponding to the trivial factorization n=n.1. If this point is reached without a square difference having been discovered earlier, then n has no other factors other than n and 1, in which case it is a prime.

Fermat used the procedure just described to factor 2027651281=44021.46061 in only 11 steps, as compared with making 4580 divisions by the odd primes up to 44021. This was probably a favourable case designed on purpose to show the chief virtue of this method: it does not require one to know all the primes less than \sqrt{n} to find factors of n.


To illustrate the application of Fermat’s method, let us factor the integer n=119143. From a table of squares, we find that 345^{2}<119143<346^{2}; thus it suffices to consider values of k^{2}-119143 for those k that satisfy the inequality 346 \leq k < (119143+1)/2=59572. The calculations begin as follows:








This last line exhibits the factorization 119143=352^{2}-69^{2}=(352+69)(352-69)=421.283, where both the factors are prime. In only seven steps, we have obtained the prime factorization of the number 119143. Of course, one does not always fare so luckily — it may take many steps before a difference turns out to be a square.

Fermat’s method is most effective when the two factors of n are of nearly the same magnitude, for in this case, a suitable square will appear quickly. To illustrate, let us suppose that n=233449 is to be factored. The smallest square exceeding n is 154^{2} so that the sequence k^{2}-n starts with:


155^{2}-23449=24025-23449=576=24^{2}. Hence, the factors of 23449 are 23449=(155+24)(155-24)=131

When examining the differences k^{2}-n as possible squares, many values can be immediately excluded by inspection of the final digits. We know, for instance, that a square must end in one of the six digits 0,1,4,5,6,9. This allows us to exclude all the values in the above example, save for 1266, 1961, 4761. By calculating the squares of the integers from 0 to 99 modulo 100, we see further that, for a square, the last two digits are limited to the following 22 possibilities:

00; 01, 04; 09; 16; 21; 24; 25; 29; 36; 41; 44; 49; 56; 61; 64; 69; 76; 81; 84; 89; 96.

The integer 1266 can be eliminated from consideration in this way. Because 61 is among the last two digits allowable in a square, it is only necessary to look at the numbers 1961 and 4761; the former is not a square, but 4761=69^{2}.

There is a generalization of Fermat’s factorization method that has been used with some success. Here, we look for distinct integers x and y such that x^{2}-y^{2} is a multiple of n rather than n itself, that is, x^{2} \equiv y^{2} \pmod {n}
Having obtained such integers d=gcd(x-y,n) (or, d=gcd(x+y,n)) can be calculated by means of the Euclidean Algorithm. Clearly, d is a divisor of n, but is it a non-trivial divisor? In other words, do we have 1<d<n?

In practice, n is usually the product of two primes p and q, with p<q so that d is equal to 1, p, q, or pq. Now, the congruence x^{2} \equiv y^{2} \pmod{n} translates into pq|(x-y)(x+y). Euclid's lemma tells us that p and q must divide one of the factors. If it happened that p|x-y and q|x-y, or expressed as a congruence x \equiv y \pmod{n}. Also, p|x+y and q|x+y yield x \equiv -y \pmod{n}. By seeking integers x and y satisfying x^{2} \equiv y^{2} \pmod{n}, where x \not\equiv \pm \pmod{n}, these two situations are ruled out. The result of all this is that d is either p or q, giving us a non-trivial divisor of n.


Suppose we wish to factor the positive integer n=2189 and happen to notice that 579^{2} \equiv 18^{2} \pmod{2189}. Then, we compute gcd(579-18,2189)=gcd(561,2189)=11 using the Euclidean Algorithm:


This leads to the prime divisor 11 of 2189. The other factor, namely 199, can be obtained by observing that gcd(579+18,2189)=gcd(597,2189)=199

The reader might wonder how we ever arrived at a number, such as 579, whose square modulo 2189 also turns out to be a perfect square. In looking for squares close to multiples of 2189, it was observed that 81^{2} -3.2189 = -6 and 155^{2}-11.2189=-54 which translates into 81^{2} \equiv -2.3 \pmod{2189} and 155^{2} \equiv -2.3^{3} \pmod{2189}.

When these congruences are multiplied, they produce (81.155)^{2} \equiv (2.3^{2})^{2} \pmod{2189}. Because the product 81.155 = 12555 \equiv -579 \pmod{2189}, we ended up with the congruence 579^{2} \equiv 18^{2} \pmod{2189}.

The basis of our approach is to find several x_{i} having the property that each x_{i}^{2} is, modulo n, the product of small prime powers, and such that their product’s square is congruent to a perfect square.

When n has more than two prime factors, our factorization algorithm may still be applied; however, there is no guarantee that a particular solution of the congruence x^{2} \equiv y^{2} \pmod{n}, with x \not\equiv \pm \pmod{n} will result in a nontrivial divisor of n. Of course, the more solutions of this congruence that are available, the better the chance of finding the desired factors of n.

Our next example provides a considerably more efficient variant of this last factorization method. It was introduced by *Maurice Kraitchik* in the 1920’s and became the basis of such modern methods as the *quadratic sieve algorithm*.


Let n=12499 be the integer to be factored. The first square just larger than n is 112^{2} = 12544. So. we begin by considering the sequence of numbers x^{2}-n for x=112, 113, \ldots. As before, our interest is in obtaining a set of values x_{1}, x_{2}, x_{3}, \ldots x_{k} for which the product (x_{1}-n)(x_{2}-n)\ldots (x_{k}-n) is a square, say y^{2}. Then, (x_{1}x_{2}\ldots x_{k})^{2} \equiv y^{2} \pmod{n}, which might lead to a non-factor of n.

A short search reveals that 112^{2}-12499=45; 117^{2}-12499=1190; 121^{2}-12499=2142; or, written as congruences, 112^{2} \equiv 3^{2}.5 \pmod{12499} ; 117^{2} \equiv \pmod{12499}; 121^{2} \equiv 2.3^{2}.7.17 \pmod{12499}. Multiplying these together results in the congruence: (112.117.121)^{2} \equiv (2.3^{2}.5.7.17)^{2} \pmod{12499}, that is, 1585584^{2} \equiv 10710^{2}\pmod{12499}. But, we are unlucky with this square combination. Because 1585584 \equiv 10710 \pmod{12499} only a trivial divisor of 12499 will be found. To be specific,



After further calculation, we notice that

113^{2} \equiv 2.5.3^{3} \pmod{12499}

127^{2} \equiv^{2} \pmod{12499}

which gives rise to the congruence (113.127)^{2} \equiv (2.3^{2}.5.11)^{2} \pmod{12499}.

This reduce modulo 12499 to 1852^{2} \equiv 990^{2} \pmod{12499} and fortunately, 1852 \not\equiv \pm {990}\pm\pmod{12499}. Calculating

gcd(1852-990,12499)=gcd(862,12499)=431 produces the factorization 12499 =29.431

Problem to Practise:

Use Kraitchik’s method to factor the number 20437.

Nalin Pithwa

Questions based on Wilson’s theorem for training for RMO

1(a) Find the remainder when 15! is divided by 17.
1(b) Find the remainder when 2(26!) is divided by 29.

2: Determine whether 17 is a prime by deciding if 16! \equiv -1 {\pmod 17}

3: Arrange the integers 2,3,4, …, 21 in pairs a and b that satisfy ab \equiv 1 {\pmod 23}.

4: Show that 18! \equiv -1 {\pmod 437}.

5a: Prove that an integer n>1 is prime if and only if (n-2)! \equiv 1 {\pmod n}.
5b: If n is a composite integer, show that (n-1)! \equiv 0 {\pmod n}, except when n=4.

6: Given a prime number p, establish the congruence (p-1)! \equiv {p-1} {\pmod {1+2+3+\ldots + (p-1)}}

7: If p is prime, prove that for any integer a, p|a^{p}+(p-1)|a and p|(p-1)!a^{p}+a

8: Find two odd primes p \leq 13 for which the congruence (p-1)! \equiv -1 {\pmod p^{2}} holds.

9: Using Wilson’s theorem, prove that for any odd prime p:
1^{2}.3^{2}.5^{2}.\ldots (p-2)^{2} \equiv (-1)^{(p+1)/2} {\pmod p}

10a: For a prime p of the form 4k+3, prove that either

(\frac{p-1}{2})! \equiv 1 {\pmod p} or (\frac{p-1}{2})! \equiv -1 {\pmod p}

10b: Use the part (a) to show that if 4k+3 is prime, then the product of all the even integers less than p is congruent modulo p to either 1 or -1.

More later,
Nalin Pithwa.

Eight digit bank identification number and other problems of elementary number theory

Question 1:

Consider the eight-digit bank identification number a_{1}a_{2}\ldots a_{8}, which is followed by a ninth check digit a_{9} chosen to satisfy the congruence

a_{9} \equiv 7a_{1} + 3a_{2} + 9a_{3} + 7a_{4} + 3a_{5} + 9a_{6} + 7a_{7} + 3a_{8} {\pmod {10}}

(a) Obtain the check digits that should be appended to the two numbers 55382006 and 81372439.

(b) The bank identification number 237a_{4}18538 has an illegitimate fourth digit. Determine the value of the obscured digit.

Question 2:

(a) Find an integer having the remainders 1,2,5,5 when divided by 2, 3, 6, 12 respectively (Yih-hing, died 717)

(b) Find an integer having the remainders 2,3,4,5 when divided by 3,4,5,6 respectively (Bhaskara, born 1114)

(c) Find an integer having remainders 3,11,15 when divided by 10, 13, 17, respectively (Regiomontanus, 1436-1476)

Question 3:

Question 3:

Let t_{n} denote the nth triangular number. For which values of n does t_{n} divide t_{1}^{2} + t_{2}^{2} + \ldots + t_{n}^{2}

Hint: Because t_{1}^{2}+t_{2}^{2}+ \ldots + t_{n}^{2} = t_{n}(3n^{3}+12n^{2}+13n+2)/30, it suffices to determine those n satisfying 3n^{3}+12n^{2}+13n+2 \equiv 0 {\pmod {2.3.5}}

Question 4:

Find the solutions of the system of congruences:

3x + 4y \equiv 5 {\pmod {13}}
2x + 5y \equiv 7 {\pmod {13}}

Question 5:

Obtain the two incongruent solutions modulo 210 of the system

2x \equiv 3 {\pmod 5}
4x \equiv 2 {\pmod 6}
3x \equiv 2 {\pmod 7}

Question 6:

Use Fermat’s Little Theorem to verify that 17 divides 11^{104}+1

Question 7:

(a) If gcd(a,35)=1, show that a^{12} \equiv {\pmod {35}}. Hint: From Fermat’s Little Theorem, a^{6} \equiv 1 {\pmod 7} and a^{4} \equiv 1 {\pmod 5}

(b) If gcd(a,42) =1, show that 168=3.7.8 divides a^{6}-1
(c) If gcd(a,133)=gcd(b,133)=1, show that 133| a^{18} - b^{18}

Question 8:

Show that 561|2^{561}-1 and 561|3^{561}-3. Do there exist infinitely many composite numbers n with the property that n|2^{n}-2 and n|3^{n}-3?

Question 9:

Prove that any integer of the form n = (6k+1)(12k+1)(18k+1) is an absolute pseudoprime if all three factors are prime; hence, 1729=7.13.19 is an absolute pseudoprime.

Question 10:

Prove that the quadratic congruence x^{2}+1 \equiv 0 {\pmod p}, where p is an odd prime, has a solution if and only if p \equiv {pmod 4}.

Note: By quadratic congruence is meant a congruence of the form ax^{2}+bx+c \equiv 0 {\pmod n} with a \equiv 0 {\pmod n}. This is the content of the above proof.

More later,
Nalin Pithwa.

Pre RMO algebra : some tough problems

Question 1:

Find the cube root of x^{3} -12x^{2} + 54x -112 + \frac{108}{x} - \frac{48}{x^{2}} + \frac{8}{x^{3}}

Question 2:

Find the square root of \frac{x}{y} + \frac{y}{x} +3 - 2\sqrt{\frac{x}{y}} -2\sqrt{\frac{y}{x}}

Question 3:

Simplify (a):

(\frac{x}{x-1} - \frac{1}{x+1}). \frac{x^{3}-1}{x^{6}+1}.\frac{(x-1)^{2}(x+1)^{2}+x^{2}}{x^{4}+x^{2}+1}

Simplify (b):
\{ \frac{a^{4}-y^{4}}{a^{2}-2ay+y^{2}} \div \frac{a^{2}+ay}{a-y} \} \times \{ \frac{a^{5}-a^{3}y^{2}}{a^{3}+y^{3}} \div \frac{a^{4}-2a^{3}y+a^{2}y^{2}}{a^{2}-ay+y^{2}}\}

Question 4:

Solve : \frac{3x}{11} + \frac{25}{x+4} = \frac{1}{3} (x+5)

Question 5:

Solve the following simultaneous equations:

2x^{2}-3y^{2}=23 and 2xy - 3y^{2}=3

Question 6:

Simplify (a):

\frac{1- \frac{a^{2}}{(x+a)^{2}}}{(x+a)(x-a)} \div \frac{x(x+2a)}{(x^{2}-a^{2})(x+a)^{2}}

Simplify (b):

\frac{6x^{2}y^{2}}{m+n} \div \{\frac{3(m-n)x}{7(r+s)} \div \{ \frac{4(r-s)}{21xy^{2}} \div \frac{(r^{2}-s^{2})}{4(m^{2}-n^{2})}\} \}

Question 7:

Find the HCF and LCM of the following algebraic expressions:

20x^{4}+x^{2}-1 and 25x^{4}+5x^{3} - x - 1 and 25x^{4} -10x^{2} +1

Question 8:

Simplify the following using two different approaches:

\frac{5}{6- \frac{5}{6- \frac{5}{6-x}}} = x

Question 9:

Solve the following simultaneous equations:

Slatex x^{2}y^{2} + 192 = 28xy$ and x+y=8

Question 10:

If a, b, c are in HP, then show that

(\frac{3}{a} + \frac{3}{b} - \frac{2}{c})(\frac{3}{c} + \frac{3}{b} - \frac{2}{a})+ \frac{9}{b^{2}}=\frac{25}{ac}

Question 11:

if a+b+c+d=2s, prove that

4(ab+cd)^{2} - (a^{2}+b^{2}-c^{2}-d^{2})^{2}= 16(s-a)(s-b)(s-c)(s-d)

Question 12:

Determine the ratio x:y:z if we know that

\frac{x+z}{y} = \frac{z}{x} = \frac{x}{z-y}

More later,
Nalin Pithwa

Those interested in such mathematical olympiads should refer to:


(I am a tutor for such mathematical olympiads).