108

I hope they used a program to generate that as output!

Comments
  • 8
    Lol.

    Can't come up with anything where that's a good solution.

    Unless it's on very low resources..
  • 0
    @lotd yeah, it's what @sylflo said. If the point of the program isn't to generate them it is much quicker to hardcode them then to calculate them.
  • 0
  • 1
    @Player2 figured that, but i only find it to be a good solution if it's running on very low resources..

    Be it low hardware specs or simply for the sake of it being lightweight.. :)
  • 2
    im pretty sure if you're gonna hard code prime numbers, you do it by hand
  • 1
    @apisarenco do you need the whole list ? Because if you just need to generate random big primes, the Miller-Rabin test is your friend. Sure, it's probabilistic, but it's really fast and accurate enough that for very big numbers, you're more likely to get a wrong prime with the deterministic version due to EM caused error than to get a wrong one from the probabilistic one. Look it up if you haven't heard of it, pretty useful :)
  • 0
    @apisarenco Well, Miller-Rabin can still be used, it is fast and reliable enough that you could just use it on every non-5-ending odd number and still iterate faster than the trivial prime generation anyways. Although I have mostly used it on huge numbers where trivial generation doesn't even apply. Maybe I should have a look at that project Euler thing. Heavy prime number usage can only mean fun.
Add Comment