Remix.run Logo
Sharlin a day ago

If you plot the positive integers two-dimensionally in a square spiral arrangement, eg.

  5 4 3
  6 1 2
  7 8 9
and so on, and mark all primes, what you get is the Ulam spiral: https://en.wikipedia.org/wiki/Ulam_spiral
lioeters a day ago | parent [-]

I was curious why/how someone would even think about arranging numbers in a spiral. The origin story is funny:

> According to Martin Gardner, Ulam discovered the spiral in 1963 while doodling during the presentation of "a long and very boring paper" at a scientific meeting. These hand calculations amounted to "a few hundred points". Shortly afterwards, Ulam and collaborators used MANIAC II at Los Alamos Scientific Laboratory to extend the calculation to about 100,000 points.

openasocket 21 hours ago | parent [-]

Funnily enough, it was almost discovered several years earlier. The science fiction author Arthur C Clarke wrote in “The City and the Stars” a passage that, as an aside, describes a mathematician looking for patterns in the primes by arranging them in a spiral grid. But he never actually tried doing this himself, and so never actually saw the pattern.

lioeters 21 hours ago | parent [-]

From Chapter 6 of "The City and the Stars" (1953) by Arthur C Clarke.

JESERAC SAT MOTIONLESS within a whirlpool of numbers. The first thousand primes, expressed in the binary scale that had been used for all aritmetical operations since electronic computers were invented, marched in order before him. Endless ranks of 1's and 0's paraded past, bringing before Jeserac's eyes the complete sequence of all those numbers that possessed no factors except themselves and unity. There was a mystery about the primes that had always fascinated Man, and they held his imagination still.

Jeserac was no mathematician, though sometimes he liked to believe he was. All he could do was to search among the infinite array of primes for special relationships and rules which more talented men might incorporate in general laws. He could find how numbers behaved, but he could not explain why. It was his pleasure to hack his way through the arithmetical jungle, and sometimes he discovered wonders that more skillful explorers had missed.

He set up the matrix of all possible integers, and started his computer stringing the primes across its surface as beads might be arranged at the intersections of a mesh. Jeserac had done this a hundred times before, and it had never taught him anything. But he was fascinated by the way in which the numbers he was studying were scattered, apparently according to no laws, across the spectrum of the integers. He knew the laws of distribution that had already been discovered, but always hoped to discover more.

He could scarcely complain about the interruption. If he had wished to remain undisturbed, he should have set his annunciator accordingly. As the gentle chime sounded in his ear, the wall of numbers shivered, the digits blurred together, and Jeserac returned to the world of mere reality.