![]() |
![]() |
#1 |
Aug 2002
8,689 Posts |
![]() |
![]() |
![]() |
![]() |
#2 |
Jan 2023
32·7 Posts |
![]()
My best candidate so far using a moderately unoptimized stochastic solver is 25 digits. It's an interesting problem that seems to resist being broken down into subproblems, as it's not guaranteed that taking the "exception" later rather than earlier will always be optimal.
|
![]() |
![]() |
![]() |
#3 |
Jun 2016
408 Posts |
![]()
Like the previous poster, I can't really see a smart way to do this problem. My single-threaded code for the base problem took nearly 2 hours, and the bonus problem is substantially harder. I've now multi-threaded my code, but it looks like it's going to take about 2 days to find an answer. I'm using python and primefac, not sure if other languages might be faster but I assume primefac is using C or something behind the scenes, and the isprime function seems to be similar in speed to Pari/GP. Without giving any spoilers as to the details, has anyone come up with a smarter approach?
|
![]() |
![]() |
![]() |
#4 |
"Ed Hall"
Dec 2009
Adirondack Mtns
132048 Posts |
![]()
My approach was less smart, brute force, with C++, but it took a couple hours (maybe - I didn't time it) for the base problem and I haven't seen a solution to the bonus part after many days. I didn't time anything, but I also ran a version that included all the 0-5 for the basic and it completed 0-4 toward the bonus. They also haven't posted or responded to my email, so I don't even know if I'm on the right track. I have been in error in the past, but at least then they told me, so I could try something else.
I'm going to entirely rework what I did, in C this time, and see if it does better and also use it to check my previous solutions. |
![]() |
![]() |
![]() |
#5 |
Jan 2017
17410 Posts |
![]()
My Python code (using is_prime from gmpy2) was faster, but not by so much that it'd likely indicate a fundamentally different search.
Last fiddled with by uau on 2023-03-10 at 13:10 Reason: broken quote tag |
![]() |
![]() |
![]() |
#6 |
Jun 2016
25 Posts |
![]()
Just did a quick test and seems like gmpy2 is about 6 times faster than the library I was using, so I'll switch to that, thanks!
|
![]() |
![]() |
![]() |
#7 |
Jun 2003
110010111112 Posts |
![]() |
![]() |
![]() |
![]() |
#8 |
Sep 2017
20710 Posts |
![]()
How large (in terms of number of digits) are the best solutions people found so far (for both problems)?
|
![]() |
![]() |
![]() |
#9 |
Jul 2015
1010112 Posts |
![]()
How can we know that a solution is the optimal
|
![]() |
![]() |
![]() |
#10 |
Sep 2017
32·23 Posts |
![]() |
![]() |
![]() |
![]() |
#11 |
Jan 2017
2·3·29 Posts |
![]() |
![]() |
![]() |
![]() |
Thread Tools | |
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Ponder This - April 2023 | tgan | Puzzles | 7 | 2023-04-20 04:07 |
Collected Ibm ponder this solutions | R. Gerbicz | Puzzles | 6 | 2020-03-30 05:58 |
March 2016 | Xyzzy | Puzzles | 21 | 2016-06-09 20:26 |
gmp 4.2 due in March | Mystwalker | GMP-ECM | 4 | 2006-02-01 12:00 |