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...
Show HN: Prime Number Grid Visualizer
21–30 of 53 posts
Re: Show HN: Prime Number Grid Visualizer
#22When 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 ex…
546n + 242 is always even
546n + 243 is always divisible by 3
546n + 244 is always even
546n + 255 is always divisible by 7.
Etc.
It's similar to how in base 10 you never see a prime ending in 0,2,4,6,8 or 5 since those numbers are clearly divisible by 2 or 5. In 546's case you have a lot of factors so even more gaps.
You also get the pattern appearing again since the number is even and the non-even factors repeat their pattern starting from the halfway point.
Re: Show HN: Prime Number Grid Visualizer
#23Re: Show HN: Prime Number Grid Visualizer
#24When 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 ex…
In a similar way 210=2*3*7*5 also gives wide empty columns (if you ignore ignore first row where 2,3,5,7 themselves are primes)
It helps if you think of it in terms of where the non primes are located instead of where the primes are. Multiples of 2, 3, 5 form a very regular pattern. Wrap it around in a grid and you get straight lines which are either straight vertical or slightly shifted depending on the divisors of width. Stack a couple of repetitive patterns and you still get a repetitive pattern. If the positions which are not primes form a regular pattern, the inverted image also forms recognizable pattern. Of course the primes don't form perfectly regular pattern and but most the visible repetition are result of small prime multiples.
Re: Show HN: Prime Number Grid Visualizer
#25When 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 ex…
Those are just columns that happen to share factors with 546 and happen to line up together. 546 is a very composite number (lots of factors!) 546n + 242 is always even 546n + 243 is always divisible by 3 546n + 244 is always even 546n + 255 is always divisible by 7. Etc. It's similar to how in base 10 you never see a prime ending in 0,2,4,6,8 or 5 since those numbers are clearly divisible by 2 or 5. In 546's case yo…
To finish it off (skipping even numbers)...
546n + 247 is always divisible by 13.
546n + 249 is always divisible by 3.
Re: Show HN: Prime Number Grid Visualizer
#26I 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...
Re: Show HN: Prime Number Grid Visualizer
#27Earlier quoted context omitted.
Those are just columns that happen to share factors with 546 and happen to line up together. 546 is a very composite number (lots of factors!) 546n + 242 is always even 546n + 243 is always divisible by 3 546n + 244 is always even 546n + 255 is always divisible by 7. Etc. It's similar to how in base 10 you never see a prime ending in 0,2,4,6,8 or 5 since those numbers are clearly divisible by 2 or 5. In 546's case yo…
That makes perfect sense. Thank you. To finish it off (skipping even numbers)... 546n + 247 is always divisible by 13. 546n + 249 is always divisible by 3.
Re: Show HN: Prime Number Grid Visualizer
#28When 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 ex…
I am interested to know how you discovered this! Was it by happenstance or did you know to look for this?
Re: Show HN: Prime Number Grid Visualizer
#29Re: Show HN: Prime Number Grid Visualizer
#30I 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...
woah, yeah, what is up with the galaxies spin motion/transformation? there's gotta be a good explanation
Now when you take a vertical pattern like you see with column width=10 and add one more to the column size (so make it 11) the pattern is now offset by one pixel on each row. This makes the vertical pattern render diagonally as each row is offset by a pixel.
So you get the patterns going between vertical and diagonal. This can get really interesting when you have a bunch of composite numbers in a row. Each composite number has it's own vertical pattern as described above. So 435 has gaps every 3rd and 5th number (and for other factors) since those will be multiple of 3 or 5. Now the next number, 436 rotates this pattern 45degrees since it offsets each row by 1 pixel. But.. 436 has it's own patterns, eg. every second number is a multiple of 2 when offset from 436 since 436 is even. So it has it's own vertical patterns but also shows the diagonals from gaps in 435.
Anyway these well understood gaps in primality give a galaxy appearance for this simple reason. You're seeing well understood vertical patterns shifting to render diagonally with new vertical patterns from alignment on the next number and repeat.