I found an 1800 digit prime number that is also the Trump mugshot
(media.greatawakening.win)
🗣️ AUTISM FTW 💬
You're viewing a single comment thread. View all comments, or full comment thread.
Comments (44)
sorted by:
Does this have meaningful relevance to what Musk posted?
Well, yes and no. You can literally turn any image into a prime number, given the image is not too large (I can do 60x30 pixels in about 5 minutes now). It does not scale linearly; a 90x60 pixel image seems to take forever right now.
The whole thing is still single-threaded, so I could make it 32 times faster immediately if I weren't so lazy...
I set it up such that the input image is converted to black and white. I use 1 for white and 8 for black.
When I change the number (after establishing it is not a prime number), I pick a random digit and if the value is 1, I change it to 7, to make sure it is "light" and does not become too dark. Also, I want to specifically increase the likelihood of finding prime numbers with a 17 in it :-) If the value is not 1, I just pick another random digit between 0 and 9, excluding the current value, of course.
The script is completely suboptimal. There are multiple conversions between strings, lists and integers. You could probably make it 100 times faster easily, but I am just having a beer and love programming.
How many lines of code is the program?