Show HN: Prime Number Grid Visualizer
Reminds me of a really cool coding trick to get a "random" permutation of an array in O(1) time/memory.
https://lemire.me/blog/2017/09/18/visiting-all-values-in-an-...
This is very cool, it reminds me of an ulam spiral. https://en.m.wikipedia.org/wiki/Ulam_spiral
The trick is to do 88 columns, punch them out on a roll, and run it through a player piano.
The first thing I thought of was why not add the QR markers (i.e. the three squares) and then see if a prime grid is scannable.
Perhaps a prime grid will generate a valid QR code that is itself a prime number in QR!
When choosing rows = 4000 and columns = 546, an interesting pattern emerges.
For all integers n ≥ 0, the ranges [243 + (n * 546)] to [249 + (n * 546)] inclusive appear to contain no prime numbers. Same with the ranges [297 + (n * 546)] to [303 + (n * 546)].
For both sets of ranges, the minimum gap between the closest neighbouring primes appears to be at least 10 (in decimal). Does anyone know of a number-theoretic explanation for this kind of pattern?
Someone's going to find the correct column count to reveal the hidden message to build an intergalactic space ship with FTL travel.
It'd be great to be able to plot only the primes that satisfy some simple (at first anyways) math operations. "Show me the primes that when (math operation) by (a set of values) equals (set of results). EG when (mult,div,squared) by (n1,n2...) equals (0,e^2, ...). Exploring for surprise patterns!
A feature Id like to see is an option to invert the grid, i.e. show the composites instead of the primes
I'm probably an idiot but having the columns at a multiple of 6 is very pleasing
Could be fun to turn these into initial conditions for Game of Life
The density of prime numbers remains remarkably consistent as you increase the grid size. Even the end of a 10,000 x 10,000 grid had just as many primes per inch as the earlier numbers
Reminds me of what I do when trying to look for structure in binary data. Print it to the screen in either bits or bites with word wrap enabled and drag the window around.
So cool! I'd like to be able to start at any number
There's a way to warp this in 3D and Contact two sides together to show the framework blueprint of a Portal device.
Ha, super, thanks for making it.
Check out 431 columns - this yields no obvious persistent patterns.
Add option to skip all even numbers, another to skip all numbers ending with 5. Also, a way to see the number when you click a pixel or space.
It's fun seeing all these patterns. I did some edit. I was thinking that skipping over numbers divisible by 2 and 5 will get rid of most visible gaps, but they keep emerging.
columns = 420 has an interesting set of troughs down the sides and middle.
cool
kick miamia9423 in Roblox
I spammed the columns from 1 to 402 (with 400 rows), and i saw some cool patterns. I can see a few nodes of clockwise rotation that converges into a single node from >200 columns that starts makes its way down the screen. Trippy.
I made a screen recording of it: https://n0ssc.com/wp-content/uploads/2025/08/prime-doublespe...