Almost a Theorem: How I Stumbled On Ulam's Spiral

Boredom's a wonderful thing.

When I was but a wee lad, no more than 13,... alright, not that wee. shut up... I discovered a mathematical theorem. Something regarding an infinite triangle or pyramid of numbers with interesting properties. It had something to do with multiples of 3, I'm pretty sure.

I lost the notes. 'Cuz of course I did.

Much more recently, during some other boring courses (recurring theme! yay!), I decided I might as well try to recreate it. I drew several interesting tables of numbers, didn't find mine, but then I stumbled on this beauty (pictured above), which after some research, proved to be called Ulam's Spiral, discovered by Stanislaw Ulam some 50 years ago, in exactly the same manner as me: doodling during a boring presentation. 

Because it takes a special kind of boredom to discover new math.

Forming the bloody thing is simple. Write down 1, then go whichever way you like, and start spiralling outwards with a sequence of numbers as long as you dare, and eventually into madness. Mind, the spiral has to be square. The picture above is pretty self-explanatory.

But it appears he was more bored than me. I stopped at merely remarking, after getting to around 80, that holy shit the perfect squares line up on 2 diagonals, the odd on the right and the even on the left. It's easily provable: the difference between 2 consecutive squares is an arithmetic progression with common difference of 2. The difference between 4 and 1 is 3, between 9 and 4 it's 5, between 16 and 9 it's 7, and so on. From here, it's obvious how the diagonals form. Still, damn beautiful tidbit.

Stanislaw Ulam's presentation, unlike mine, didn't end at this point. So he didn't stop either, and went on spiralling outwards up to a few hundred. Presumably bored to tears, he made the call that he might as well mark the primes. They don't really form after a rule, but what the hell.

The property of this spiral he stumbled upon is amazing.

In order to check if it held, he ran calculations on up to a few thousand and eventually up to 10.000.000. Despite what's normally taught, a rule was emerging from the chaos. Nay, a pattern. Primes were evidencing a pattern!

Here's why this is a big deal: primes bug mathematicians. They are simple: numbers that can't be divided by anything else besides themselves and 1. And those don't count. (ba dum tisch, MATH ZINGER!) And yet, they seem to be forming at random. There's no rule to them, no overarching method. They seem to be... kinda popping up along the way to infinity. The biggest progress made about them happened centuries ago, when it was proved that there's no largest prime. Otherwise said, they are infinitely dickish, and mathematicians don't like that. And yet, despite their reliable irregularity, Ulam was noticing it ain't quite so random.

The reasoning goes like this: if primes were to appear entirely randomly, then you would expect them to appear randomly scattered around Ulam's Spiral. And yet, at large scale and with the primes marked, the Spiral looks like this:

Yep. A lot of them seem to pop up along clearly defined diagonals and lines. There's some method to the madness.

Even better, Ulam soon realized you could start the spiral from any number you wanted, and it would still have this property. Spirals with other start points are even prettier. For example, starting from 41 gives you this:

That's hot.
But wait, it gets better.

Notice that empty spaces in the large-scale figure above also go along certain diagonals? In order to study them more clearly, H. Rudd, the owner of the epic website, (whose work on it is obsessive, and I mean that in the best way possible) decided to try and spread the numbers apart a bit. Instead of this compact version of the spiral, he built one where after each number there's an empty space left along the spiral, like this:

He calls this the second iteration. The third iteration's got 2 empty spaces, and so on.
Anyway, he set up the program in order to see what the Ulam spiral with marked primes looked like built this way. And...

... the emergent pattern is even clearer.

This same person also made a great toy, so you can make your own Ulam's Spirals:

This kind of story is evidence that if you like mathematics, just casual like, there's nothing stopping you from discovering a new theorem on your own. It doesn't need to be something massive and complicated that requires you to work on it full-time for years. Because no matter for how long it's studied, math has a certain tendency to troll. There's always one more incredibly interesting and quite simple thing that lies just beneath the surface, and nobody's noticed it. Yet.

No comments :

Post a Comment