Skip to content
Generate prime numbers whose binary representation looks like any image
HTML JavaScript
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.


Inspired by this: Does there exist a prime number whose representation on a phone screen looks like a giraffe?


Access it here

Primg has made it to Hacker News' front page! :)

Update: now you can share URLs by appending the decimal number after the hash on the URL (you lose the image tough). For example, this is a prime dog: Thanks for jchavannes and fovc from Hacker News for sharing ideas on this feature.


  • find a way to update the DOM while doing heavy processing solved: Web Workers to the rescue
  • use a more clever way (maybe histograms stuff) to find the threshold number now using average of image
  • make it faster (currently takes minutes) "solved" by reducing canvas size from 50x50 to 32x32
  • make it prettier
  • make code cleaner
You can’t perform that action at this time.