The world's largest prime number — visualized

Philip Bump took the recently discovered 17-million-digit prime number and, six digits at a time, converted it into RGB colors. This is the result.


  1. Well great. You spend all day workin’ real hard and then you gaze into an image of the very soul of madness and doom.

    Guess it’s the cults for me again.

  2. Bah. They should have written the number in hexadecimal, taken 6-digit chunks, and then rendered that as an image. It’s a bit neater that way.

      1. It’s a Mersenne Prime.  The hexadecimal representation of a Mersenne Primes is very boring.  It would be a white canvas with no more than two not-white pixels in opposite corners.

          1. Well, look at this way: Maggie posted both at the same time.  One in the body of the post and one as the background…

        1. Seems that’d illustrate the Mersenne Prime – ness of the number. Which would help people understand math. Instead, everyone just sees noise and thinks magic eye.

    1. On top and slightly left of center, a cuddly lion wearing spectacles!  No wait, he’s cool and they’re Ray-Ban Wayfarers… oh never mind.

    1. Now that you mention it, I’m getting a LOT of texture there, fluctuating between Hindu and Mayan, very elegant.

    1. I don’t know of any visually-available structure in a given prime number (apart from the stuff about mersenne primes being 2^p-1 of course). afaik, there’s no really good reason to think there will be any, and arguably a good reason to think there isn’t any.

      I failed at math and am now a statistician, so the following may be completely wrong:

      Although there are reasons we sort of know the average size of the “step” from one prime number to the next, the same knowledge (assuming the Riemann hypothesis) also implies that the _actual_ step size between any two adjacent primes will be very chaotic.

      Think of it as knowing the distance of a flight from SF to NYC in miles, versus knowing it in inches. The former won’t help with the latter at all, even though they’re related.

      Since an interesting visualization of a prime will (probably?) be very sensitive to the exact step size, the chaos is a vague reason to think there won’t be one.However, if you look at the _overall_ distribution of primes it can be both cool and mathematically interesting. Google will give you several examples.

  3. I can’t help but wonder where the padding is, to fit within 1726 * 1666 * 6 pixels (because it’s a prime number, it shouldn’t divide cleanly). Also, if there are only 2 digits per RGB value, there’s a lot of color space wasted. I can’t do the math now, but seems like it should be converted to hexadecimal first.

    1. You can easily scale the 00-99 up to the 8-bit 0-255 range to make 24-bit color RGB values. 

      As others have said, the hex representation would be very boring since it’s a 2^k-1 prime (ie: All FF’s).

    2. What needs to divide cleanly into 1726x1666x6 is the number of digits, not the number itself.
      According to wikipedia, the number has 17,425,170 digits, but the image only uses 17,253,096, which leaves 172,074 digits unaccounted for … I wonder if that couldn’t have been done better. Or maybe he did after all use more than 6 digits per pixel to fill the remaining space?
      If I do a prime factor decomposition, I get 6* 3*5*7*17 * 1627 (which appears to be a prime number)
      So logically, the dimensions 1785*1627 would seem more appropriate. Unless I just made a mistake…

    1. True randomness can only be described by repeating every random bit, it con not be reduced. This isn’t randomness because it can be describe as 2^k-1, which is much simpler.

      1. Exactly.  Truly random things don’t have short-form representations.

        (They can act random though.  Pi passes every meaningful test for randomness, except that it’s not in any way random.)

  4. Now why didn’t they choose an aspect ratio, such that there wouldn’t be an ugly black line at the end? After all, a prime number can’t end with a bunch of zeroes.

  5. In the spirit of things, I just did something similar with the 33rd Mersenne prime (in wikipedia’s list) The two images encode the magnitude of the digits of 2^(859433)-1 in base 13 and 17. The computer is still chugging away at rendering an image for 2^(57885161)-1 in base 919 (A large base reduces the size of the image.)

Comments are closed.