110 points · by geonnave · 8y ago · 53 comments
I put up a show HN, but no one liked it :) https://news.ycombinator.com/item?id=16198861
https://github.com/geonnave/primg/commit/7ec6cfaa4b581902ea1...
179769313486231590772930519078902473361797697894230657273430081157732675805500963132708477322407536021120113879871393357110553379400815780032957688591226535854678434413850350192892043530395436831148532011789232552521569332295554081981793617293526812832242447096911185919439189235252915185597964786711096720343
tbh ;-) puts number.to_s(2).split("").in_groups_of(32).map{|g| g.join("")}
Well... it looks like your face was illuminated from the right?I think I see how to view this. I can see a silhouette.
17976931348623159077293
05190789024733617976978
94230657273430081157732
67580550096313270847732
24075360211201138798713
93357110553379400815780
03295768859122653585467
84344138503501928920435
30395436831148532011789
23255252156933229555408
19817936172935268128322
42447096911185919439189
23525291518559796478671
1096720343
look at this and unfocus your eyes $ time python -c 'import gmpy; gmpy.next_prime(2**2500)'
real 0m0.443s
Was it taking a lot longer than that for you?Edit: I can see that there is an element of luck in terms of how many candidates you have to look at, but I'm still seeing everything in this size range take under 2 seconds. Maybe it's a question of what probability of error you're accepting from the test?
Afterthought: actually, I was thinking on using IPFS to store stuff, but I do not know if its model applies to this scenario. Feedback is appreciated.
Edit: I bet a RLE would compress down really nicely except for the bottom row if you want to reduce URL sizes
We need to disrupt the "images as primes" industry!
https://github.com/geonnave/primg/blob/master/index.html#L82
Could go double as fast subtracting 2 instead of 1 (why try the even numbers).
The Python version I wrote and linked to back then (which is a bit less general): https://gitlab.com/snippets/1694391
20 minutes in, it is up to 13388 in Firefox.
Funny enough, I ran the same image through Chrome, it said it was finish at iteration 458. I'm guessing it is not completely deterministic?
Changing a single out of 3232 bits gives you 1024 variations. Changing two already gives you 10241023/2 = 523776 variations.