Readit News logoReadit News

Deleted Comment

susam commented on Prime Number Grid   susam.net/primegrid.html... · Posted by u/todsacerdoti
mickeyp · 6 days ago
I really love susam's blog posts and curiosity. I highly recommend that people check out his site for more of his insights.
susam · 5 days ago
Thank you for the kind words, Mickey! Your website too is a treasure trove of excellent information, especially for Emacs users like me!
susam commented on Prime Number Grid   susam.net/primegrid.html... · Posted by u/todsacerdoti
davedx · 6 days ago
I think another interesting feature would be if you could change the number base to 16 or some other base, I'm really curious if the pattern would change.
susam · 5 days ago
> I think another interesting feature would be if you could change the number base to 16 or some other base, I'm really curious if the pattern would change.

Whether a number is prime has nothing to do with the base we use to write it. Changing the base wouldn't affect the visualisation at all. A number is either prime or not regardless of base. Since this grid only marks prime positions with circles, the pattern would look exactly the same. In fact, you can already imagine the numbers in any base you like while looking at the visualisation.

susam commented on Prime Number Grid   susam.net/primegrid.html... · Posted by u/todsacerdoti
Tepix · 6 days ago
Great visualization! Can you please add a on-mouse-over so when i hover my mouse over a dot i can see the prime number it represents?

Would we see new patterns emerge if the number of columns increases per row by X (X being constant or perhaps prime numbers ;-) )?

susam · 6 days ago
Adding mouseover text to every prime number slows down rendering on large grids (say, with a million or more numbers). So mouseover text is available as an optional feature. You can toggle it using the 't' button at the top: click once to enable the text, and click again to disable it.
susam commented on Prime Number Grid   susam.net/primegrid.html... · Posted by u/todsacerdoti
martinclayton · 6 days ago
Hours of fun (stimulation?) to be had...

Try these shapes: 100x113, then 100x114, then 100x115, the "patterns" swing from slant down, to vertical, to slant up.

I'd love this (even more) with some animation and colo(u)r options.

susam · 6 days ago
This was just a quick experiment I put together last night in my free time, so the tool is quite bare bones. If you're on a desktop browser and don't mind opening the developer tools console, you can run this little snippet to animate the grid:

  cols.value = 1n; setInterval(() => {cols.value++; readInput()}, 250);

susam commented on Prime Number Grid   susam.net/primegrid.html... · Posted by u/todsacerdoti
jona-f · 6 days ago
If you select 30, 60 or 90 columns you get the clearest patterns. It kinda seems that the more divisors the number of columns has, the clearer the vertical clusters are. And somehow 30, 60 and 90 stand out. Number theory is so weird. I expected more randomness.
susam · 6 days ago
The reason vertical clusters appear in these examples is that all your chosen numbers are multiples of 6. A prime number greater than 3 leaves a remainder of either 1 or 5 when divided by 6. In other words:

For all primes p greater than 3, p ≡ ±1 (mod 6).

Therefore, when the total number of columns is a multiple of 6, all primes except 2 fall into the same columns, namely 1, 5, 7, 11, 13, 17 and so on.

susam commented on Prime Number Grid   susam.net/primegrid.html... · Posted by u/todsacerdoti
throw310822 · 6 days ago
Kind of surprising, my intuitive idea of primes is that they become rarer much faster, while there's really a ton of them.
susam · 6 days ago
They indeed do become rarer. Plotting all the primes in a single row makes this apparent, like so: https://susam.net/primegrid.html#1-1-1000000

In fact, according to the celebrated prime number theorem, the number of primes less than or equal to n is asymptotic to n/log n, which means the density of primes near n is asymptotic to 1/log n.

I have a small section about this at https://susam.net/journey-to-prime-number-theorem.html#prime... if you want to read more about this.

See also: https://en.wikipedia.org/wiki/Prime_number_theorem

susam commented on Prime Number Grid   susam.net/primegrid.html... · Posted by u/todsacerdoti
susam · 6 days ago
Hello! I wrote this simple prime number grid visualiser last night, just for fun. It is inspired by the "Show HN" post https://news.ycombinator.com/item?id=44888548 that I stumbled upon a few days ago.

My tool uses the Miller-Rabin primality test with prime bases drawn from https://oeis.org/A014233 to determine whether a number is prime. This allows it to handle numbers up to 3317044064679887385961980.

For example, https://susam.net/primegrid.html#3317044064679887385961781-2... shows the upper limit of the numbers this tool can check. The three circles displayed there represent the following prime numbers:

  3317044064679887385961783
  3317044064679887385961801
  3317044064679887385961813
I hope this is fun for you too!

u/susam

KarmaCake day21852September 17, 2011
About
This page is best viewed with a wide screen display.

              ,-------------------------------------------.
              |                                           |\
              |   ,===================================.   | \
              |   |                                   |   |  \
              |   |  C:\>lynx susam.net               |   |  |
              |   |                                   |   |  |
              |   |                                   |   |  |
              |   |                                   |   |  |
              |   |                                   |   |  |
              |   |                                   |   |  |
              |   |                                   |   |  |
              |   |                                   |   |  |
              |   |                                   |   |  |
              |   |                                   |   |  |
              |   |                                   |   |  |
              |   |___________________________________|   |  ,
              |                                           | /-,
            ,-|___________________________________________|/ /|
           /         (_____________________________)        / |
          /_______________________________________________ /  |
         |                                                 |  |___
         | [@]                                             |  |   )
         |                                    [==========] |  /  /
         | ||||||||||                         [==========] | /  /
         |_________________________________________________|/  /
         _________________________________________________    /
        /  #  = = = =  # # # #  = = = =  # # #  /- - -/  /,__/
       /                                                //
      /  = = = = = = = = = = = = = ##  # # #  # # # #  //
     /  ## = = = = = = = = = = = = =  # # #  = = = #  //
    /  ### = = = = = = = = = = = ##         = = = #  /`
   /  #### = = = = = = = = = = ###    #    = = = #  /
  /  ###  ### ============= ## ##  # # #  === = #  /
  `-----------------------------------------------'

View Original