Читать книгу The Number Mysteries: A Mathematical Odyssey through Everyday Life - Marcus Sautoy du - Страница 23

How can you use rice and a chessboard to find primes?

Оглавление

Legend has it that chess was invented in India by a mathematician. The King was so grateful to the mathematician that he asked him to name any prize as a reward. The inventor thought for a minute, then asked for 1 grain of rice to be placed on the first square of the chessboard, 2 on the second, 4 on the third, 8 on the fourth, and so on, so that each square got twice as many grains of rice as were on the previous square.

The King readily agreed, astonished that the mathematician wanted so little—but he was in for a shock. When he began to place the rice on the board, the first few grains could hardly be seen. But by the time he’d got to the 16th square, he was already needing another kilogram of rice. By the 20th square, his servants had to bring in a wheelbarrow full. He never reached the 64th and last square on the board. By that point the total number of grains of rice on the board would have been a staggering

18,446,744,073,709,551,615

If we tried to repeat the feat at the heart of London, the pile of rice on the 64th square would stretch to the boundaries of the M25 and would be so high that it would cover all the buildings. In fact, there would be more rice in this pile than has been produced across the globe in the last millennium.


FIGURE 1.24 Repeated doubling makes numbers grow very quickly.

Not surprisingly, the King of India failed to give the mathematician the prize he had been promised and was forced into parting with half his fortune instead. That’s one way maths can make you rich.

But what has all this rice got to do with finding big prime numbers? Ever since the Greeks had proved that the primes go on for ever, mathematicians had been on the look-out for clever formulas that might generate bigger and bigger primes. One of the best of these formulas was discovered by a French monk called Marin Mersenne. Mersenne was a close friend of Pierre de Fermat and René Descartes, and he functioned like a seventeenth-century Internet hub, receiving letters from scientists all across Europe and communicating ideas to those he thought could develop them further.

His correspondence with Fermat led to the discovery of a powerful formula for finding huge primes. The secret of this formula is hidden inside the story of the rice and the chessboard. As you count up the grains of rice from the first square of the chessboard, the cumulative total quite often turns out to be a prime number. For example, after three squares there are 1+2+4=7 grains of rice, a prime number. By the fifth square there are 1+2+4+8+16=31 grains of rice.

Mersenne wondered whether it would turn out to be true that whenever you landed on a prime number square on the chessboard, the number of grains of rice up to that point might also be a prime. If it was, it would give you a way of generating bigger and bigger primes. Once you’d counted the prime number grains of rice, just move to this square on the chessboard and count the number of grains of rice up to this point, which Mersenne hoped would be an even bigger prime.

Unfortunately for Mersenne and for mathematics, his idea didn’t quite work. When you look on the 11th square of the chessboard, a prime number square, then up to that point there are a total of 2,047 grains of rice. Sadly, 2,047 is not prime—it equals 23×89. But although Mersenne’s idea didn’t always work, it has led to some of the largest prime numbers that have been discovered.

The Number Mysteries: A Mathematical Odyssey through Everyday Life

Подняться наверх