Hacker News new | past | comments | ask | show | jobs | submit login

Same, I was so surprised to get it solved at the second row, after ~8 attempts to find a prime without the numbers that had not matched.

    12347
      -
   [solved]



It seems a lot of us came up with 12347 for the first line.


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.


I read the "help" thing, which suggested 71429 as the first guess, so I started there. (9 was right, and the other digits were wrong. That meant the second guess got the right digits, and the third guess got the right prime.)


56809 is a pretty good second guess for this situation :p


Ha, those were exactly my first 2 guesses.




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: