This is the famous Ulam spiral, invented by the Jewish mathematician Stanisław Ulam (pronounced OO-lam) to represent prime numbers on a square grid:
The Ulam spiral of prime numbers
The red square represents 1, with 2 as the white block immediately to its right and 3 immediately above 2. Then 5 is the white block one space to the left of 3 and 7 the white block one space below 5. Then 11 is the white block right beside 2 and 13 the white block one space above 11. And so on. The primes aren’t regularly spaced on the spiral but patterns are nevertheless appearing. Here’s the Ulam spiral at higher resolutions:

The Ulam spiral x2
The Ulam spiral x4
The primes are neither regular nor random in their distribution on the spiral. They stand tantalizingly betwixt and between. So the numbers represented on this Ulam-like spiral, which looks like an aerial view of a city designed by architects who occasionally get drunk:

Ulam-like spiral of abundant numbers
The distribution of abundant numbers is much more regular than the primes, but is far from wholly predictable. And what are abundant numbers? They’re numbers n such that sum(divisors(n)-n) > n. In other words, when you add the divisors of n less than n, the sum is greater than n. The first abundant number is 12:
12 is divisible by 1, 2, 3, 4, 6 → 1 + 2 + 3 + 4 + 6 = 16 > 12
The abundant numbers go like this:
12, 18, 20, 24, 30, 36, 40, 42, 48, 54, 56, 60, 66, 70, 72, 78, 80, 84, 88, 90, 96, 100, 102, 104, 108, 112, 114, 120, 126, 132, 138, 140, 144, 150, 156, 160, 162, 168, 174, 176, 180, 186, 192, 196, 198, 200, 204, 208, 210, 216, 220, 222, 224, 228, 234, 240, 246, 252, 258, 260, 264, 270… — A005101 at the Online Encyclopedia of Integer Sequences
Are all abundant numbers even? No, but the first odd abundant number takes a long time to arrive: it’s 45045. The abundance of 45045 was first discovered by the French mathematician Charles de Bovelles or Carolus Bovillus (c. 1475-1566), according to David Wells in his wonderful Penguin Dictionary of Curious and Interesting Numbers (1986):
45045 = 3^2 * 5 * 7 * 11 * 13 → 1 + 3 + 5 + 7 + 9 + 11 + 13 + 15 + 21 + 33 + 35 + 39 + 45 + 55 + 63 + 65 + 77 + 91 + 99 + 105 + 117 + 143 + 165 + 195 + 231 + 273 + 315 + 385 + 429 + 455 + 495 + 585 + 693 + 715 + 819 + 1001 + 1155 + 1287 + 1365 + 2145 + 3003 + 3465 + 4095 + 5005 + 6435 + 9009 + 15015 = 59787 > 45045
Here’s the spiral of abundant numbers at higher resolutions:

Abundant numbers x2
Abundant numbers x4
Negating the spiral of the abundant numbers — almost — is the spiral of the deficient numbers, where sum(divisors(n)-n) < n. Like most odd numbers, 15 is deficient:
15 = 3 * 5 → 1 + 3 + 5 = 9 < 15
Here’s the spiral of deficient numbers at various resolutions:

Deficient numbers on Ulam-like spiral
Deficient numbers x2
Deficient numbers x4
The spiral of deficient numbers doesn’t quite negate (reverse the colors of) the spiral of abundant numbers because of the very rare perfect numbers, where sum(divisors(n)-n) = n. That is, their factor-sums are exactly equal to themselves:
• 6 = 2 * 3 → 1 + 2 + 3 = 6
• 28 = 2^2 * 7 → 1 + 2 + 4 + 7 + 14 = 28
• 496 = 2^4 * 31 → 1 + 2 + 4 + 8 + 16 + 31 + 62 + 124 + 248 = 496
Now let’s try numbers n such than sum(divisors(n)) mod 2 = 1 (“n mod 2″ gives the remainder when n is divided by 2, i.e. n mod 2 is either 0 or 1). For example:
• 4 = 2^2 → 1 + 2 + 4 = 7 → 7 mod 2 = 1
• 18 = 2 * 3^2 → 1 + 2 + 3 + 6 + 9 + 18 = 39 → 39 mod 2 = 1
• 72 = 2^3 * 3^2 → 1 + 2 + 3 + 4 + 6 + 8 + 9 + 12 + 18 + 24 + 36 + 72 = 195 → 195 mod 2 = 1
Here are spirals for these numbers:

Ulam-like spiral for n such than sum(divisors(n)) mod 2 = 1
sum(divisors(n)) mod 2 = 1 x2
sum(divisors(n)) mod 2 = 1 x4
sum(divisors(n)) mod 2 = 1 x8
sum(divisors(n)) mod 2 = 1 x16

















