Hacker News new | ask | show | jobs
by MauranKilom 1617 days ago
While natural in terms of just inputting numbers, it's also not bad to use as first guess because primes are denser (in an "average absolute distance" sense) the lower the magnitude you're around. Without having checked, I would expect there to be more primes of the form 123** than 987**, so you're more likely to gain correct digits with this guess.

Edit: I checked, it's 9 vs 8 primes. But nearby prefixes also have more and there's a lot of variance. Still, there are overall more primes among the same range of smaller numbers (1000-5499 has ~4400 primes, 5500-99999 has ~4000).

Note that, despite this, you probably shouldn't include 0 in the starting guess (e.g. 10247) because 0 will be in the solution less frequently (can't be the leading digit), meaning you gain less info on average.