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:

Solution to a “nice analysis question for RMO practice”

The question from a previous blog is re-written here for your convenience. 


How farthest from the edge of a table can a deck of playing cards be stably overhung if the cards are stacked on top of one another? And, how many of them will be overhanging completely away from the edge of the table?


The figure below shows how two and three cards can be stacked so that the mass of cards is equal on either side of the vertical line passing through the corner of table’s edge in order to just balance them under gravity:

the set of first two cards are arranged as follows (the horizontal lines represents the cards):



the set of three cards are arranged as follows:




We can see that the length of the overhand is a harmonic series of even numbers multiplied by the length of one card, L.

Overhand distance is (\frac{1}{2} + \frac{1}{4} + \frac{1}{6} + \ldots + \frac{1}{52 \times 2})L for 52 cards.

It may be noted that the series if continued to infinity leads to H_{\infty}^{E}.

That is, H_{\infty}^{E}=\frac{1}{2} + \frac{1}{4} + \frac{1}{6} + \frac{1}{8} + \ldots

This series is known to diverge as proved below:

First consider, H_{\infty}=1+ \frac{1}{2} + \frac{1}{3} + \frac{1}{4} + \frac{1}{5} + \frac{1}{6} + \frac{1}{7} + \frac{1}{8}+ \ldots, which is, greater than

1+ \frac{1}{2} + \frac{1}{4} + \frac{1}{4} + \frac{1}{8} + \frac{1}{8} + \frac{1}{8} + \frac{1}{8}+ \ldots, which is greater than 1+ \frac{1}{2} + \frac{1}{2} + \frac{1}{2} + \ldots. Hence, H_{\infty} diverges as we go on adding 1/2 indefinitely.

Now, let H_{E}=\frac{1}{2} + \frac{1}{4} + \frac{1}{6} + \frac{1}{8} + \ldots = \frac{1}{2}(1+ \frac{1}{2} + \frac{1}{3} + \frac{1}{4} + \ldots)=\frac{1}{2}H_{\infty}

Since H_{\infty} diverges, H_{E}also diverges.

Hence, the “overhang series” also diverges.

This means that the cards can be stacked indefinitely and the overhang distance can reach infinity. However, this will happen very slowly as shown in the table below:

\begin{array}{cc} n^{E} & H_{n}^{E}\\ 2 & 0.5 \\ 10 & 1.46 \\ 100 & 2.59 \\ 1000 & 3.74 \\ 10000 & 4.89 \\ 100000 & 6.05 \end{array}

Computing the number of cards that completely overhang off the table needs information about the overhang distance for different number of cards. As shown below in the figure, four cards are required to have one card completely away from the edge of the table. This is because (\frac{1}{2} + \frac{1}{4} + \frac{1}{6} + \frac{1}{8}=1.0417 >1).

(the set of four cards are arranged as follows:)





We can see that the length of the overhang is a harmonic series of even numbers multiplied by the length of one card, L:

Overhang distance = (\frac{1}{2} + \frac{1}{4} + \frac{1}{6} + \ldots + \frac{1}{52 \times 2})L for 52 cards

It may be noted that the series if continued to infinity, leads to H_{\infty}^{E}

H_{\infty}^{E} = \frac{1}{2} + \frac{1}{4} + \frac{1}{6} + \frac{1}{8} + \ldots

This series is known to diverge. This means that the cards can be stacked indefinitely and the overhang can reach infinity. However, this will happen very slowly as shown in the table below:

\begin{array}{cc}    n^{E} & H_{\infty}^{E} \\    2 & 0.5 \\    10 & 1.46 \\    100 & 2.59 \\    1000 & 3.74 \\    10000 & 4.89 \\    100000 & 6.05    \end{array}

Computing the number of cards that completely overhang off the table needs information about the overhang distance for different numbers of cards. As shown in the above schematic figures of cards with overhangs, four cards are required to have one card completely away from the edge of the table. This is because

(\frac{1}{2} + \frac{1}{4} + \frac{1}{6} + \frac{1}{8})=1.0417>1

For the second card to overhang completely, leaving the first card (and hence one half) that is already completely overhung, it is now necessary that

(\frac{1}{4} + \frac{1}{6} + \frac{1}{8} + \ldots + \frac{1}{2n})>1, or

(\frac{1}{2} + \frac{1}{4} + \frac{1}{6} + \frac{1}{8} + \ldots + \frac{1}{2n} )>1+ \frac{1}{2}

where n needs to be found out. By generating some more data, we can find the value of n to be 11.

For third overhanging card, we need

(\frac{1}{6} + \frac{1}{8} + \ldots + \frac{1}{2n})>1 or

(\frac{1}{2} + \frac{1}{4} + \frac{1}{6}+\frac{1}{8}+ \ldots + \frac{1}{2n})>1+\frac{1}{2} + \frac{1}{4}

Thus, for m completely overhanging cards, we find n such that H_{2n}^{E} > 1+ H_{2(m-1)}^{E}

The table below shows these values wherein we see an approximate pattern of arithmetic progression by 7.

\begin{array}{cccc}    m & n & m & n \\    1 & 4 & 11 & 78 \\    2 & 11 & 12 & 85 \\    3 & 19 & 13 & 92 \\    4 & 26 & 14 & 100 \\    5 & 33 & 15 & 107 \\    6 & 41 & 16 & 115 \\    7 & 48 & 17 & 122 \\    8 & 55 & 18 & 129 \\    9 & 63 & 19 & 137 \\    10 & 70 & 20 & 144    \end{array}

By examining the pattern in the table, we can get a simple rule to estimate the number of completely overhanging number of cards m, with an error of utmost one, for n cards stacked.

m = round(\frac{n}{7.4})=round(\frac{10n}{74}).


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

Hope you enjoyed the detailed analysis…

More later,

Nalin Pithwa


Pick’s theorem: a geometry problem for RMO practice

Pick’s theorem:

Consider a square lattice of unit side. A simple polygon (with non-intersecting sides) of any shape is drawn with its vertices at the lattice points. The area of the polygon can be simply obtained as B/2+I-1 square units, where B is the number of lattice points on the boundary; I = number of lattice points in the interior region of the polygon. Prove this theorem.


Refer Wikipedia 🙂 🙂 🙂


Nalin Pithwa.


Pre-RMO or RMO algebra practice problem: infinite product

Find the product of the following infinite number of terms:

\frac{7}{9} \times \frac{26}{28} \times \frac{63}{65} \times \ldots = \prod_{m=2}^{\infty}\frac{m^{3}-1}{m^{3}+1}

m^{3}-1=(m-1)(m^{2}+m+1), and also, m^{3}+1=(m+1)(m^{2}-m+1)=(m-1+2)((m-1)^{2}+(m-1)+1)

Hence, we get P_{m}=\frac{7}{9} \times \frac{26}{28} \times \frac{63}{65} \times \ldots \times \frac{m^{3}-1}{m^{3}+1}, which in turn, equals

(\frac{1}{3} \times \frac{7}{3}) \times (\frac{2}{4} \times \frac{13}{7}) \times (\frac{3}{5} \times \frac{21}{13})\times \ldots (\frac{m-1}{m+1} \times \frac{m^{2}+m+1}{m^{2}-m+1}), that is, in turn equal to

\frac{2}{3} \times \frac{m^{2}+m+1}{m(m+1)}, that is, in turn equal to

\frac{}{} \times (1+ \frac{1}{m(m+1)}), so that when m \rightarrow \infty, and then P_{m} \rightarrow 2/3.

personal comment: I did not find this solution within my imagination !!! 🙂 🙂 🙂

The credit for the solution goes to “Popular Problems and Puzzles in Mathematics” by Asok Kumar Mallik, IISc Press, Foundation Books. Thanks Prof. Mallik !!


Nalin Pithwa


Algebra Training for RMO and Pre-RMO: let’s continue: Fibonacci Problem and solution

Fibonacci Problem:

Leonardo of Pisa (famous as Fibonacci) (1173) wrote a book “Liber Abaci” (1202), wherein he introduced Hindu-Arabic numerals in Europe. In 1225, Frederick II declared him as the greatest mathematician in Europe when he posed the following problem to defeat his opponents.


Determine the rational numbers x, y and z to satisfy the following equations:

x^{2}+5=y^{2} and x^{2}-5=z^{2}.


Definition: Euler defined a congruent number to be a rational number that is the area of a right-angled triangle, which has rational sides. With p, q, and r as a Pythagorean triplet such that r^{2}=p^{2}+q^{2}, then \frac{pq}{2} is a congruent number.

It can be shown that square of a rational number cannot be a congruent number. In other words, there is no right-angled triangle with rational sides, which has an area as 1, or 4, or \frac{1}{4}, and so on.

Characteristics of a congruent number: A positive rational number n is a congruent number, if and only if there exists a rational number u such that u^{2}-n and u^{2}+n are the squares of rational numbers. (Thus, the puzzle will be solved if we can show that 5 is a congruent number and we can determine the rational number u(=x)). First, let us prove the characterisitic mentioned above.

Necessity: Suppose n is a congruent number. Then, for some rational number p, q, and r, we have r^{2}=p^{2}+q^{2} and \frac{pq}{2}=n. In that case,

\frac{p+q}{2}, \frac{p-q}{2} and n are rational numbers and we have

(\frac{p+q}{2})^{2}=\frac{p^{2}+q^{2}}{4}+\frac{pq}{2}=(\frac{r}{2})^{2}+n and similarly,


Setting u=\frac{r}{2}, we get u^{2}-n and u^{2}+n are squares of rational numbers.


Suppose n and u are rational numbers such that \sqrt{u^{2}-n} and \sqrt{u^{2}+n} are rational, when

p=\sqrt{u^{2}+n}+\sqrt{u^{2}-n} and q=\sqrt{u^{2}+n}-\sqrt{u^{2}-n}

and 2n are rational numbers satisfying p^{2}+q^{2}=(2n)^{2} is a rational square and also \frac{pq}{2}=n, a rational number which is a congruent number.

So, we see that the Pythagorean triplets can lead our search for a congruent number. Sometimes a Pythagorean triplet can lead to more than one congruent number as can be seen with (9,40,41). This set obviously gives 180 as a congruent number. But, as 180=5 \times 36=5 \times 6^{2}, we can also consider a rational Pythagorean triplet (\frac{9}{6}, \frac{40}{6}, \frac{41}{6}), which gives a congruent number 5 (we were searching for this congruent number in this puzzle!). We also determine the corresponding u=\frac{r}{2}=\frac{41}{12}.

The puzzle/problem is now solved with x=\frac{41}{12}, which gives y=\frac{49}{12}, and z=\frac{31}{12}.

One can further show that if we take three rational squares in AP, u^{2}-n, and u^{2}, and u^{2}+n, with their product defined as a rational square v^{2} and n as a congruent number, then x=u^{2}, y=v is a rational point on the elliptic curve y^{2}=x^{3}-n^{2}x.


1) Popular Problems and Puzzles in Mathematics: Asok Kumar Mallik, IISc Press, Foundation Books, Amazon India link:

2) Use the internet, or just Wikipedia to explore more information on Fibonacci Numbers, Golden Section, Golden Angle, Golden Rectangle and Golden spiral. You will be overjoyed to find relationships amongst all the mentioned “stuff”.


Nalin Pithwa

Solution to a RMO algebra practice question

Refer to question posted on blog of Mar 13 2018, reproduced here for your convenience. Compare your solution with the one given here:


Show that the following expression: [4-3x+\sqrt{16+9x^{2}-24x-x^{3}}]^{1/3}+[4-3x-\sqrt{16+9x^{2}-24x-x^{3}}]^{1/3} remains constant in the interval 0 \leq x \leq 1. Find this constant value.


Let y equal the given expression for x in the prescribed interval. Then, taking cube of both sides, we write




The only real value of y=2, a constant. The roots of the quadratic equation for 0<x<1 are complex. It is easy to check that y=2 for both x=0 and 1.

Alternately, derive the square roots of the expression within the radical; you can use the method of undetermined coefficients for this.


Nalin Pithwa.