Skip to content

rustytriangles/gaussian_primes

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

An interactive toy for exploring the patterns described in this blog post by John D Cook.

A little background. A Gaussian integer is basically a complex number where both the real and imaginary component are integers. Gaussian primes are a factorization domain in the Gaussian integers. That means that they behave similarly to the "regular" prime numbers.

The Gaussian primes have a number of interesting patterns & properties, such as the ones described in this paper. The one this widget is exploring is the following.

  • Pick a Gaussian integer
  • Start moving in the +X direction
  • When you hit a Gaussian prime, turn left 90 degrees
  • Continue until you reach the starting point

As far as anyone knows, the resulting patterns always appear to return to the starting point. In many cases, they do that with a simple rectangle.

screenshot

But sometimes they wander for quite a while before returning.

screenshot

They're usually symmetric, but not always.

screenshot

I thought this was pretty fascinating, so I created this simple React page to play with it. You can run it here. Try clicking different locations. You can zoom in and out (a little bit) using the + and - keys.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published