Update to our Number Properties app – Ulam’s Spiral

Our Number Properties app was released a few weeks ago, and we have finally found the time (during our Christmas break!) to tweak it. More details about this Android app can be found on its dedicated page.

Ulam's spiral - step 1

Amongst some minor improvements (slightly faster Sieve of Eratosthenes!), the main addition to this version is the capability to draw Ulam’s spiral.

It’s a really interesting way to graphically represent the distribution of prime numbers. You start by writing down the numbers in a spiral way.

You then either highlight the prime numbers, or delete the non-primes, and you obtain a spiral pattern with only some numbers visible.

Ulam's spiral - step 2

We’ve applied this to the app, and after calculating the maximum square that can be occupied by the diagram (depending on your screen resolution), we associate each number to a pixel, and draw each prime number with a certain colour, leaving out the non-primes. On a Samsung Galaxy SII, that’s roughly 282000 numbers.

Screenshot - centre on 1


Screenshot - centre on 52114


As you can see from these screenshots, when expanding to larger numbers, patterns start to emerge, mainly diagonal lines.

Changing the starting point of the spiral also shows identical patterns (here, the starting point is 52114), but an overall different picture.

You get some more information about the spiral (number of primes, etc) and can also change the origin, from the menu inside this activity.

This Android app is available for free on the Android Market, so enjoy :-)

Leave a Reply