OU blog

Personal Blogs

Richard Walker

What I'm Reading: 'Port Out, Starboard Home and other language myths'

Visible to anyone in the world
Edited by Richard Walker, Monday 22 June 2026 at 00:23

The author, Michael Quinion, is a man after my own heart. (I mean because he is an etymologist, he's not looking for a transplant or anything.) His book is really fascinating and a very enjoyable read. I've only read part way through at the minute but when I've finished I'll post a short review. Watch this space!

I'd not heard of this book before and I simply stumbled across when searching for the origin of the phrase 'All at sixes and sevens'.

The phrase is found in Chaucer and Shakespeare with the same meaning as today (to be flummoxed, or in a state of confusion) and from Quinion's book I learned the most probable explanation is that it comes from a dice game where 'sixes and sevens' were proverbially risky bets.

The reason I was looking up the expression is that in my Quora Digest feed the redoubtable Alon Amit answered the question: to prove that for any n we can find a n -digit number which is divisible by two super n (or some greater power) and entirely made up of the digits six and seven

For example today is the 22nd and here is number satisfying those conditions

7777777777666766667776 equals two super 22 multiplication 11 multiplication 47 multiplication 337 multiplication 10643272511

There are other pairs of digits that could be used instead of six and seven but I think the Original Poster probably recalled the phrase 'at sixes and sevens' and thought those numbers would be a good choice. 

If you are interested here is a Python program that implements Amit's algorithm at the end of this post.

# Generates a number with num digits, all 6s or 7, 
# which is divisble by 2^num or some higher power of 2.

def next(n):
    digits = len(str(n))
    if n % 2**(digits + 1):
        return int('7' + str(n))
    else:
      return int('6' + str(n))

num = 22

n = 6
for step in range(1,num):
    n = next(n)
print(n)
Permalink
Share post
Richard Walker

The beautiful and surprising Three Gap Theorem, and an easy experiment that can build intuition about it

Visible to anyone in the world
Edited by Richard Walker, Saturday 20 June 2026 at 00:15

I'll begin by saying what the Three Gap Theorem is. I'll show some examples and then explain a simple way you can play with the theorem using only paper and pencil. After that I'll outline the theorem's history, and lastly I'll explain how the graphics were produced

Theorem

Draw a circle and mark a point anywhere on its circumference. Then choose an angle and rotate the point through that angle about the circle's centre. 

Mark this point, then repeat the process, using the same angle, to get a third point. Carry on in this way, always rotating the current point through the same angle to get the next point.

Eventually the total angle travelled will exceed a full turn and the circle will be traversed a second time. As long as the angle chosen was not a simple fraction of a whole turn, the new points will not coincide with existing points but be new points, each splitting the gap between two points that were formerly adjacent into two smaller gaps.   

We can carry on indefinitely and each time we go round the circle again new points will split existing gaps into gaps of smaller size. This will lead to an increasingly complex situation and we naturally expect each successive snapshot to contain more and more different gap sizes

But it doesn't!. The number of distinct gaps is only ever two or three, never more. Moreover if the number of gap sizes is three, the size of the largest gap will be the sum of the other two gap sizes.

This is the Three-Gap Theorem.

Examples
sketch.png

These examples were generated by a Python program which I 'll say more about later. If you zoom the browser in you can see the number of points I stopped at in each and the gap sizes in decreasing order. It's interesting that, for example, from 3 to 4 points increases the number of gap sizes from two to three, but then from 4 to 5 it drops to two again. Another interesting feature is that in every case there appears to be a two-fold symmetry.

History

The behaviour of the gaps was described by the noted mathematician Hugo Steinhaus in 1957 but he only conjectured that the number of distinct gaps never exceeded three. The theorem was first proven in 1958 by Sós, Surányi and Świerczkowski, and since then different proof have been found, although none that seem to me very simple. The area is still the object of active research; for example I believe the two-fold symmetry was provem fairly recently and at least one researcher is studying whether generalizations exist to e.g. three dimensions.

Pencil and paper investigation

You don't need anything complicated to play around with these gaps, just pencil and paper. I drew a circle round a large cup, then marked made two marks on a strip of paper and stepped off the points round the circle., which as easy to do and worked quite well I felt.

sketch%20%281%29.png

You can see three distinct gap lengths. I think Steinhaus must have been playing around in a similar way when he made his discovery, don't you?

Computing

I'd never heard of thie Three Gaps Theorem until a few days back, but when I stumbled across it, I thought it was really surprising and fascinating. So first I knocked up a quick and dirty Python program, which simulated moving round a circle in same size steps as described above. Once I had made a list of the points I calculated the gaps and sure enough there were only two numbers. After I tweaked the numbers a bit I managed to get three numbers sometimes, but never more. So my experiments seemed to corroborate the theorem.

But I wanted something a bit more dramatic to illustrate it and although I once wrote a Python program to draw pie charts doing it all myself by hand requires too much heavy lifting and so I asked 'Google AI' to produce a program. I was very specific about what I wanted and I spelt out things like the colours and what we were trying to simulate. The AI was aware of the theorem so that helped a lot.

I asked for a legend that would list the gap sizes and specified that I wanted the gaps shown by 'pizza slices', i.e. coloured sectors, because I thought would stand out a lot better than just using differently coloured circular arcs

On the first attempt, the AI made a mistake and we got a Python error so I told it what the error message was and it diagnosed what had done wrong and corrected it and now it worked.

However the colours were a bit wishy-washy and I wanted something a bit more dramatic so I managed to get it to change the colours and then I had the program that generated the pictures that I've shown earlier in this post.

I thought the AI did a good job and it wrote code in a couple of seconds that would've taken me probably a couple of hours at a minimum so I thought as a productivity aid it was quite impressive. I thought it is very interesting that it not only corrected its mistake, but explain to me what it had done wrong.

I hope you found this introduction to the Three Gap Theorem interesting, and if you've done the pencil and paper exercise, you may have got some intuition about why the theorem is true.

That's very far from a proof of course, and at the moment I didn't feel that I understood any proof well enough to try and sketch it out in a block post, but I'm working on it. Hopefully, I'll be able to come up with something accessible and convincing!

Permalink
Share post

This blog might contain posts that are only visible to logged-in users, or where only logged-in users can comment. If you have an account on the system, please log in for full access.

Total visits to this blog: 6331537