### John Conway and his fruitful fractions

Following on from the series of ‘Pascal’s Triangle and its Secrets‘ posts, guest author David Benjamin shares another delightful piece of mathematics – this time relating to prime numbers.

At the time of writing the largest known prime number has $24862048$ digits. The number of digits does not reflect the true size of this prime but if we were to type it out at Times New Roman font size 12, it would reach approximately $51.5$ km, or about $32$ miles. Astonishing!

Patrick Laroche from Ocala, Florida discovered this Mersenne prime on December 7, 2018. I was surprised to discover that it’s exponent $82589933$ is the length of the hypotenuse of a primitive Pythagorean triple where $82589933^{2} = 30120165^{2} + 76901708^{2}$ as indeed are 8 of the exponents of those currently ranked from 1 to 10.

The Greek mathematician Euclid of Alexandria ($\sim$325 BC-265 BC) was arguably the first to prove that there are an infinite number of primes – and since then, people have been searching for new ones. Some do it for kudos, for the prize money, to test the power of computers and the need to find more of the large primes used to help protect the massive amount of data which is being moved around the internet.

Mersenne primes, named after the French monk Marin Mersenne, are of the form $2^{p} -1$, where the exponent $p$ is also prime. Mersenne primes are easier to test for primality, which is one reason we find so many large ones (all but one of the top ten known primes are Mersenne). When Mersenne primes are converted to binary they become a string of $1$s, which makes them suitable for computer algorithms and an excellent starting point for any search.

Since generally testing numbers for primality is slow, some have tried to find methods to produce primes using a formula. Euler’s quadratic polynomial $n^2+n+41$ produces this set of $40$ primes for $n = 0$ to $39$. When $n=40$, the polynomial produces the square number $1681$. Other prime-generating polynomials are listed in this Wolfram Mathworld entry.

The French mathematician Lejeune Dirichlet proved that the linear polynomial $a+nb$ will produce an infinite set of primes if $a$ and $b$ are coprime for $n=0,1,2,3,4,…$. Then again, it also produces an infinite number of composite numbers! However, this gem: $224584605939537911 + 1813569659748930n$ produces 27 consecutive primes for $n=0$ to $n=26$ – and of course, all the primes are in arithmetic progression.

## 14 fruitful fractions

The primes are unpredictable, and become less common as they get larger. Consequently there is no formula that will generate all the prime numbers. However, there is a finite sequence of fractions, that – given an infinite amount of time – would generate all the primes, and in sequential order.

They are the fruitful fractions, created by the brilliant Liverpool-born mathematician, John Horton Conway (1937–2020) who, until his untimely death from complications related to COVID-19, was the John von Neumann Emeritus Professor in Applied and Computational Mathematics at Princeton University, New Jersey, USA.

The fruitful fractions are

The first time I encountered this set of fractions was in the wonderful book, The Book of Numbers, by Conway and Guy. I was so intrigued as to how Conway came up with his idea, I emailed him to ask. I was delighted to receive an outline of an explanation and even a second set of fractions, neither of which I can now find – it was 1996 and pre-cloud storage! But no worries… Conway explains everything in this lecture, which also demonstrates his passion for mathematics and his ability to express his ideas in a relaxed and humorous way, even when he searches for an error in his proof on 26 minutes. The lecture also includes an introduction to Conway’s computer language, FRACTRAN, which includes the statement:

It should now be obvious to you that you can write a one line fraction program that does almost anything, or one and a half lines if you want to be precise‘.

## Using the fractions to find prime numbers

Here’s how the fractions are used to generate primes.

• Start with the number $2$
• Multiply by each of the fourteen fractions until you find one for which the product is an integer
• Starting with this new integer, continue multiplying through the fractions until another integer is produced. (If this process reaches fraction $N=\frac{55}{1}$, the integer’s product with N is guaranteed to be another integer as N has a denominator of $1$; the process continues with this new integer being multiplied by fraction A)
• Continue multiplying through the set to create more integers
• When the integer is a power of $2$, its exponent will be a prime number.

The 19 steps needed to produce the first prime number are:

$2 \overset{ \times M}{\rightarrow} 15 \overset{ \times N}\rightarrow 825\overset{ \times E} \rightarrow 725 \overset{ \times F}\rightarrow 1925\overset{ \times K} \rightarrow 2275 \overset{ \times A}\rightarrow 425 \overset{ \times B}\rightarrow 390 \overset{ \times J}\rightarrow 330 \overset{ \times E}\rightarrow 290 \overset{ \times F}\rightarrow 770 \overset{ \times K}\rightarrow 910\overset{ \times A} \rightarrow 170\overset{ \times B} \rightarrow 156\overset{ \times J} \rightarrow 132\overset{ \times E} \rightarrow 116 \overset{ \times F}\rightarrow 308\overset{ \times K} \rightarrow 364\overset{ \times A} \rightarrow 68 \overset{ \times I}\rightarrow 4 \equiv2^{2}$

The number of steps needed to produce the first 7 primes are shown in the table below:

And here is the start and end of the sequence of fractions used to produce the next prime number from $2^{2}$:

$4 \overset{ \times M}{\rightarrow} 30 \overset{ \times M}\rightarrow 225\overset{ \times N} \rightarrow 12375 \overset{ \times E}\rightarrow 10875 \rightarrow \cdots \rightarrow 232 \overset{ \times F}{\rightarrow} 616 \overset{ \times K}\rightarrow 728\overset{ \times A} \rightarrow 136 \overset{ \times I}\rightarrow 8\equiv2^{3}$

The steps needed for the first 34 primes are given as OEIS A007547 and the first 8102 products in the B-list for A007542.

The successive primes are produced almost like magic – but the number of multiplications needed to produce each new prime becomes larger and larger, and so the method, though wonderfully inventive, is not at all efficient.

### A Mathematician’s Guide to Wordle

We invited mathematician and wordplay fan Ali Lloyd to share his thoughts on hit internet word game phenomenon Wordle. If you’re not familiar with the game, we recommend you go and have a play first.

When I first saw Wordle I said what I saw many other people subsequently say: “Oh, so it’s a bit like Mastermind but with words? That’s a neat idea”.

### The hunt for almost Pythagorean triples

Pythagorean triples have a long and storied tradition. But what about the near misses?

You’d be surprised how much math[s] you can learn by exploring some of the implications and ramifications of what may seem at first no more than a trivial brainteaser

Martin Gardner

This is a follow-up to James’s FAQ for the 2014 film The Imitation Game.

Shakuntala Devi is a 2020 Indian Hindi-language film about Shakuntala Devi, a performer of impressive mental calculations, available now on Amazon Prime.

### The extraordinary Cardano family

In this guest post by David Benjamin, we explore a little of the life and times of Girolamo Cardano and his interesting family.

Girolamo Cardano (1501- 1576) was at various times in his life a physician, mathematician, inventor, addictive gambler and prisoner. He was the illegitimate son of Fazio Cardano and Chiara Micheria, and the Cardano family was a dysfunctional 16th Century version of the Simpsons.

### Doughnuts in the Sand

This is a guest post by semi-regular guest author, mathematician-turned-maths-teacher Andrew Stacey.

I like having something mathematical to think about for times when I’m, for example, waiting in a queue to get into the supermarket. Annie Perkin’s Math Art Challenge has been a good source of such of late. These are a series of mathematically-inspired artistic activities, ranging from designing celtic knots to constructing origami polyhedra and everything in between.

My eye was caught by one on sandpiles – I’ll explain exactly what they are in a moment. One feature that made it attractive was that it was quite simple to write a program to generate diagrams. I find that the maths that interests me usually comes from looking at variations, and for that I need to generate a lot of examples. Doing them by hand quickly becomes laborious. So I whipped up a program (which I later converted to an online version) and ran it a few times to see what happened.

### Fi-Bee-onacci

Andrew Stacey: I have a confession to make that would probably get me thrown out of every respectable Mathematics Society – were I to belong to one.

I am not a fan of the Fibonacci sequence.

Neither am I keen on the golden ratio. It’s not even transcendental.

It’s not really their fault, it’s just that they get levered in everywhere whether they belong there or not. Particularly in discussions of nature and beauty, and this is exemplified by that ridiculous origin story. We’ve been subjected to a variety of bizarre origin stories over the years (cough radioactive spider cough) but the rabbit story is another level of bizarre.

So I was intrigued, and then delighted, when one of my students, who is a bee enthusiast, told me about a genuinely natural occurrence of the Fibonacci sequence in the ancestry of bees.

I’ll let her take up the story.