The Summer 2017 Mathematics A To Z: Ulam’s Spiral


Gaurish, of For the love of Mathematics, asked me about one of those modestly famous (among mathematicians) mathematical figures. Yeah, I don’t have a picture of it. Too much effort. It’s easier to write instead.

Summer 2017 Mathematics A to Z, featuring a coati (it's kind of the Latin American raccoon) looking over alphabet blocks, with a lot of equations in the background.
Art courtesy of Thomas K Dye, creator of the web comic Newshounds. He has a Patreon for those able to support his work. He’s also open for commissions, starting from US$10.

Ulam’s Spiral.

Boredom is unfairly maligned in our society. I’ve said this before, but that was years ago, and I have some different readers today. We treat boredom as a terrible thing, something to eliminate. We treat it as a state in which nothing seems interesting. It’s not. Boredom is a state in which anything, however trivial, engages the mind. We would not count the tiles on the floor, or time the rocking of a chandelier, or wonder what fraction of solitaire games can be won if we were never bored. A bored mind is a mind ready to discover things. We should welcome the state.

Several times in the 20th century Stanislaw Ulam was bored. I mention solitaire games because, according to Ulam, he spent some time in 1946 bored, convalescent and playing a lot of solitaire. He got to wondering what’s the probability a particular solitaire game is winnable? (He was specifically playing Canfield solitaire. The game’s also called Demon, Chameleon, or Storehouse, if Wikipedia is right.) What’s the chance the cards can’t be played right, no matter how skilled the player is? It’s a problem impossible to do exactly. Ulam was one of the mathematicians designing and programming the computers of the day.

He, with John von Neumann, worked out how to get a computer to simulate many, many rounds of cards. They would get an answer that I have never seen given in any history of the field. The field is Monte Carlo simulations. It’s built on using random numbers to conduct experiments that approximate an answer. (They’re also what my specialty is in. I mention this for those who’ve wondered what, if any, mathematics field I do consider myself competent in. This is not it.) The chance of a winnable deal is about 71 to 72 percent, although actual humans can’t hope to do more than about 35 percent. My evening’s experience with this Canfield Solitaire game suggests the chance of winning is about zero.

In 1963, Ulam told Martin Gardner, he was bored again during a paper’s presentation. Ulam doodled, and doodled something interesting enough to have a computer doodle more than mere pen and paper could. It was interesting enough to feature in Gardner’s Mathematical Games column for March 1964. It started with what the name suggested, a spiral.

Write down ‘1’ in the center. Write a ‘2’ next to it. This is usually done to the right of the ‘1’. If you want the ‘2’ to be on the left, or above, or below, fine, it’s your spiral. Write a ‘3’ above the ‘2’. (Or below if you want, or left or right if you’re doing your spiral that way. You’re tracing out a right angle from the “path” of numbers before that.) A ‘4’ to the left of that, a ‘5’ under that, a ‘6’ under that, a ‘7’ to the right of that, and so on. A spiral, for as long as your paper or your patience lasts. Now draw a circle around the ‘2’. Or a box. Whatever. Highlight it. Also do this for the ‘3’, and the ‘5’, and the ‘7’ and all the other prime numbers. Do this for all the numbers on your spiral. And look at what’s highlighted.

It looks like …

It’s …

Well, it’s something.

It’s hard to say what exactly. There’s a lot of diagonal lines to it. Not uninterrupted lines. Every diagonal line has some spottiness to it. There are blank regions too. There are some long stretches of numbers not highlighted, many of them horizontal or vertical lines with no prime numbers in them. Those stop too. The eye can’t help seeing clumps, especially. Imperfect diagonal stitching across the fabric of the counting numbers.

Maybe seeing this is some fluke. Start with another number in the center. 2, if you like. 41, if you feel ambitious. Repeat the process. The details vary. But the pattern looks much the same. Regions of dense-packed broken diagonals, all over the plane.

It begs us to believe there’s some knowable pattern here. That we could get an artist to draw a figure, with each spot in the figure corresponding to a prime number. This would be great. We know many things about prime numbers, but we don’t really have any system to generate a lot of prime numbers. Not much better than “here’s a thing, try dividing it”. Back in the 80s and 90s we had the big Fractal Boom. Everybody got computers that could draw what passed for pictures. And we could write programs that drew them. The Ulam Spiral was a minor but exciting prospect there. Was it a fractal? I don’t know. I’m not sure if anyone knows. (The spiral like you’d draw on paper wouldn’t be. The spiral that went out to infinitely large numbers might conceivably be.) It seemed plausible enough for computing magazines to be interested in. Maybe we could describe the pattern by something as simple as the Koch curve (that wriggly triangular snowflake shape). Or as easy to program as the Mandelbrot Curve.

We haven’t found one. As keeps happening with prime numbers, the answers evade us. We can understand why diagonals should appear. Write a polynomial of the form 4n^2 + b n + c . Evaluate it for n of 1, 2, 3, 4, and so on. Highlight those numbers. This will tend to highlight numbers that, in this spiral, are diagonal or horizontal or vertical lines. A lot of polynomials like this give a string of some prime numbers. But the polynomials all peter out. The lines all have interruptions.

There are other patterns. One, predating Ulam’s boring paper by thirty years, was made by Laurence Klauber. Klauber was a herpetologist of some renown, if Wikipedia isn’t misleading me. It claims his Rattlesnakes: Their Habits, Life Histories, and Influence on Mankind is still an authoritative text. I don’t know and will defer to people versed in the field. It also credits him with several patents in electrical power transmission.

Anyway, Klauber’s Triangle sets a ‘1’ at the top of the triangle. The numbers ‘2 3 4’ under that, with the ‘3’ directly beneath the ‘1’. The numbers ‘5 6 7 8 9’ beneath that, the ‘7’ directly beneath the ‘3’. ’10 11 12 13 14 15 16′ beneath that, the ’13’ underneath the ‘7’. And so on. Again highlight the prime numbers. You get again these patterns of dots and lines. Many vertical lines. Some lines in isometric view. It looks like strands of Morse Code.

In 1994 Robert Sacks created another variant. This one places the counting numbers on an Archimedian spiral. Space the numbers correctly and highlight the primes. The primes will trace out broken curves. Some are radial. Some spiral in (or out, if you rather). Some open up islands. The pattern looks like a Saul Bass logo for a “Nifty Fifty”-era telecommunications firm or maybe an airline.

You can do more. Draw a hexagonal spiral. Triangular ones. Other patterns of laying down numbers. You get patterns. The eye can’t help seeing order there. We can’t quite pin down what it is. Prime numbers keep evading our full understanding. Perhaps it would help to doodle a little during a tiresome conference call.


Stanislaw Ulam did enough fascinating numerical mathematics that I could probably do a sequence just on his work. I do want to mention one thing. It’s part of information theory. You know the game Twenty Questions. Play that, but allow for some lying. The game is still playable. Ulam did not invent this game; Alfréd Rényi did. (I do not know anything else about Rényi.) But Ulam ran across Rényi’s game, and pointed out how interesting it was, and mathematicians paid attention to him.

What can you see in the number 585?


Iva Sallay’s Find The Factors page I’ve mentioned before, since it provides a daily factorization puzzle. That’s a fun recreational mathematics puzzle even if the level 6’s and sometimes level 5’s will sometimes feel impossible. I wanted to point out, though, there’s also talk about the factoring of numbers, and ways to represent that factoring, that’s also interesting and attractive to look at. It can also include neat bits of trivia about numbers and their representation. In this example 585 presents some interesting facets, including several ways that it’s a palindromic number. If you don’t care for, or aren’t interested in, the factoring puzzles you might find it worth visiting for the trivia alone.

Find the Factors

This week I watched an excellent video titled 5 x 9 is more than 45. Indeed 45 is so much more than simply 5 x 9. Every multiplication fact is much more than that mere fact, but Steve Wyborney used 5 x 9 = 45 in his video… Guess what! 585 is a multiple of 45.

As I thought about the number 585, I marveled at some of the hidden mysteries this number holds.

Since 585 is divisible by two different centered square numbers, 5 and 13, I saw that 585 could be represented by this lovely array that has 45 larger squares made up of 13 smaller colorful squares. When you look at the array, do you just see 585 squares or can you see even more multiplication and division facts? If you rotate the array 90 degrees, do the facts change?

585 Squares-1

What do you see in this…

View original post 268 more words

Looking At Things Four-Dimensionally


I’d like to close out the month by pointing to 4D Visualization, a web site set up by … well, I’m not sure the person, but the contact e-mail address is 4d ( at ) eusebeia.dyndns.org for whatever that’s worth. (Worse, I can not remember what site led me to it; if you’re out there, referent, please say so so I can thank you properly. In the meantime, thank you.) The author takes eleven chapters to discuss ways to visualize four-dimensional structures, and does quite a nice job at it. The ways we visualize three-dimensional structures are used heavily for analogies, and the illustrations — static and animated — build what feels like an intuitive bridge to me, at least.

Eusebeia (if I may use that as a name) goes through cross-sections, which are generally simple to render but which tax the imagination to put together1, and projections, and the subtleties in rendering two-dimensional images of three-dimensional projections of four-dimensional structures so that they’re sensible. It’s all quite good and I’m just sorry that my belief in the promise “More chapters coming soon!” clashes with the notice, “Last updated 13 Oct 2008”.

The main page is still being updated regularly, including a Polytope Of The Month feature. A polytope is what people call a polygon or polyhedron if they don’t want their discussion to carry the connotation of being about a two- or three-dimensional figure. It’s kind of the way someone in celestial mechanics talking about the orbit of an object around another might say periapsis and apoapsis, instead of perigee and apogee or perihelion and aphelion, although as far as I can tell people in celestial mechanics are only that precise if they suspect someone pedantic is watching them. I’m not well-versed enough to say how much polytope is used compared to polyhedron.

Anyway, for those looking for the chance to poke around higher dimensions, consider giving this a try; it’s a good read.

[1: I knew that a three-dimensional cube has, on the right slice, a hexagonal cross-section. It’s something I discovered while fiddling around with the problem of charged particles on a conductive-particule sphere, believe it or not. ]

%d bloggers like this: