4 ms·
12347 - 65393 ++-- [solution next - omitted for spoiler reasons] I was more surprised about how little trial and error I needed to find primes
by MauranKilom 5y ago
12347
-
65393
++--
[solution next - omitted for spoiler reasons]
I was more surprised about how little trial and error I needed to find primes than about how few guesses it actually took...
- syrgian 5y agoSame, 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]
- 07d046 5y agoIt seems a lot of us came up with 12347 for the first line.
- MauranKilom 5y agoWhile 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.
- scythe 5y ago56809 is a pretty good second guess for this situation :p
- dalmo3 5y agoHa, those were exactly my first 2 guesses.
- jrockway 5y agoI 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.)
- bidirectional 5y agolog(100000) is 5, so approximately 1 in 5 numbers below 100k is prime. Obviously those in the range 10000-99999 are less dense, but primes are still surprisingly common.
- madcaptenor 5y agoYou want a natural log there; ln(100000) ~ 11.5. That being said, the pool you're really working from is the numbers with last digit 1, 3, 7, or 9. One out of every 4.6 such numbers under 10^5 is prime. So just guessing until you find a prime is practical.
- 100721 5y agoHi, can you provide some search terms that will help me understand the relationship between ln and prime density?
- sebzim4500 5y agohttps://en.wikipedia.org/wiki/Prime_number_theorem https://en.wikipedia.org/wiki/Prime_number_theorem
- deleted 5y ago[deleted]
- knuthsat 5y agoOr https://en.wikipedia.org/wiki/Prime-counting_function https://en.wikipedia.org/wiki/Prime-counting_function .
- deleted 5y ago[deleted]
- bidirectional 5y agoAh you're correct. Annoying how Google interprets log(x) as base-10 (but more shame on me for not realising that e^5 is obviously not 100000). In my experience everyone uses log and ln interchangeable outside of lessons at school.