News for hackers. Stuff that matters.
Re:Primel – guess a 5 digit prime number – each guess must b... by MauranKilom on Friday January 21, 2022 @10:10AM (#30024515)

    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...
Re:Primel – guess a 5 digit prime number – each guess must b... by syrgian on Friday January 21, 2022 @10:20AM (#30024680)
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]
Re:Primel – guess a 5 digit prime number – each guess must b... by 07d046 on Friday January 21, 2022 @10:41AM (#30025051)
It seems a lot of us came up with 12347 for the first line.
Re:Primel – guess a 5 digit prime number – each guess must b... by MauranKilom on Friday January 21, 2022 @10:47AM (#30025127)
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.

Re:Primel – guess a 5 digit prime number – each guess must b... by jrockway on Friday January 21, 2022 @06:34PM (#30031368)
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.)
Re:Primel – guess a 5 digit prime number – each guess must b... by scythe on Friday January 21, 2022 @03:27PM (#30029524)
56809 is a pretty good second guess for this situation :p
Re:Primel – guess a 5 digit prime number – each guess must b... by dalmo3 on Friday January 21, 2022 @04:16PM (#30030103)
Ha, those were exactly my first 2 guesses.
Re:Primel – guess a 5 digit prime number – each guess must b... by bidirectional on Friday January 21, 2022 @12:23PM (#30026683)
log(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.
Re:Primel – guess a 5 digit prime number – each guess must b... by madcaptenor on Friday January 21, 2022 @12:43PM (#30027043)
You 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.

Re:Primel – guess a 5 digit prime number – each guess must b... by bidirectional on Friday January 21, 2022 @01:16PM (#30027602)
Ah 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.
Re:Primel – guess a 5 digit prime number – each guess must b... by Eduard on Friday January 21, 2022 @04:20PM (#30030154)
log(x) historically conventionally defaults to base-10. https://en.m.wikipedia.org/wiki/Common_logarithm
Re:Primel – guess a 5 digit prime number – each guess must b... by bidirectional on Saturday January 22, 2022 @07:08AM (#30035964)
As the wiki page itself notes though:

> On calculators, it is printed as "log", but mathematicians usually mean natural logarithm (logarithm with base e ≈ 2.71828) rather than common logarithm when they write "log".

Re:Primel – guess a 5 digit prime number – each guess must b... by 100721 on Friday January 21, 2022 @12:50PM (#30027136)
Hi, can you provide some search terms that will help me understand the relationship between ln and prime density?
Re:Primel – guess a 5 digit prime number – each guess must b... by sebzim4500 on Friday January 21, 2022 @01:01PM (#30027357)
Re:Primel – guess a 5 digit prime number – each guess must b... by knuthsat on Friday January 21, 2022 @01:05PM (#30027420)
Re:Primel – guess a 5 digit prime number – each guess must b... by lupire on Friday January 21, 2022 @02:58PM (#30029125)
And you can knock out multiples of 3 by adding digits.
Re:Primel – guess a 5 digit prime number – each guess must b... by madcaptenor on Friday January 21, 2022 @03:32PM (#30029610)
Sure, but that's a little more work than just looking at the last digit, so it's debatable whether it's worth the trouble.
Re:Primel – guess a 5 digit prime number – each guess must b... by iso1631 on Friday January 21, 2022 @12:43PM (#30027044)
Looks like there's 8,363 5 digit primes, from 10007 to 99991, so about 1 in 11
Re:Primel – guess a 5 digit prime number – each guess must b... by jameshart on Friday January 21, 2022 @12:49PM (#30027122)
Why isn’t 00002 your lower bound?
Re:Primel – guess a 5 digit prime number – each guess must b... by chockablock on Friday January 21, 2022 @12:59PM (#30027311)
The game does not accept leading zeros (00017: "Not a 5 digit prime")