December 15th, 2024

Plotting Prime Numbers (2021)

The article explores prime numbers' patterns in polar coordinates, revealing that spirals also appear in all integers. The author aims to further investigate prime numbers' mathematical significance and applications.

Read original articleLink Icon
Plotting Prime Numbers (2021)

The article discusses the intriguing patterns formed by prime numbers when plotted in polar coordinates. Inspired by a question from a mathematics group, the author explores how these patterns, such as spirals and lines, emerge. Using Python libraries like SymPy and NumPy, the author generates visualizations of prime numbers and compares them to those of all positive integers. The analysis reveals that the spiral patterns are not unique to primes but are also present in the distribution of all integers. The author explains that these spirals arise from the periodic nature of plotting points along a growing circle, with the spacing between points being related to rational approximations of \(2\pi\). The article concludes by noting that while prime numbers exhibit interesting properties, their distribution leads to sparser visualizations compared to all integers, as many sequences that could contain primes are eliminated. The author expresses a desire to further explore the mathematical significance of prime numbers and their applications.

- Prime numbers exhibit distinct patterns when plotted in polar coordinates.

- The spiral patterns are not exclusive to primes; they also appear in the distribution of all integers.

- The observed patterns are linked to rational approximations of \(2\pi\).

- The visualization of primes is sparser due to the elimination of certain sequences that cannot contain primes.

- The author aims to further study the mathematical properties and applications of prime numbers.

Link Icon 5 comments
By @mikhailfranco - about 2 months
Ulam Spiral (and see ref to Martin Gardner's famous SciAm article):

https://en.wikipedia.org/wiki/Ulam_spiral

Why do prime numbers make these spirals? | Dirichlet’s theorem and pi approximations - 3Blue1Brown

https://www.youtube.com/watch?v=EK32jo7i5LQ

By @tess0r - about 2 months
you can not only map prime numbers in a circle/spiral, but also in a triangle and get some nice knitting patterns :)

https://tessi.github.io/walking-the-ulam-spiral/

By @classic959 - about 2 months
If you're plotting primes, all the coordinates where you're not plotting are non-prime - so every 2nd coordinate will be blank. As will every 3rd and every 4th, 5th, 10th, 11th. etc etc.

Surely that's where the pattern comes from.

By @block_dagger - about 2 months
I’m not a mathematician so correct me if I’m wrong, but the patterns that emerge or more the natural result of the plotting method vs revealing anything meaningful about the distribution of primes.
By @y42 - about 2 months
shameless self promotion:

i built an "animation framework" in JavaScript around it where you can control and animate several parameters and even record the animation

https://primes.nickyreinert.de/