mersenneforum.org  

Go Back   mersenneforum.org > Fun Stuff > Puzzles

Reply
 
Thread Tools
Old 2023-03-01, 15:09   #1
Xyzzy
 
Xyzzy's Avatar
 
Aug 2002

8,689 Posts
Default Ponder This - March 2023

https://research.ibm.com/haifa/ponde...March2023.html
Xyzzy is offline   Reply With Quote
Old 2023-03-01, 19:21   #2
Tyler Busby
 
Tyler Busby's Avatar
 
Jan 2023

32·7 Posts
Default

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.
Tyler Busby is offline   Reply With Quote
Old 2023-03-09, 19:47   #3
dg211
 
Jun 2016

408 Posts
Default

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?
dg211 is offline   Reply With Quote
Old 2023-03-09, 22:56   #4
EdH
 
EdH's Avatar
 
"Ed Hall"
Dec 2009
Adirondack Mtns

132048 Posts
Default

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.
EdH is offline   Reply With Quote
Old 2023-03-10, 13:09   #5
uau
 
Jan 2017

17410 Posts
Default

Quote:
Originally Posted by dg211 View Post
Without giving any spoilers as to the details, has anyone come up with a smarter approach?
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
uau is offline   Reply With Quote
Old 2023-03-10, 14:28   #6
dg211
 
Jun 2016

25 Posts
Default

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!
dg211 is offline   Reply With Quote
Old 2023-03-10, 23:13   #7
Citrix
 
Citrix's Avatar
 
Jun 2003

110010111112 Posts
Default

Quote:
Originally Posted by dg211 View Post
Like the previous poster, I can't really see a smart way to do this problem.


For a number to be prime the last digit must be odd and not 5
Also can avoid numbers that will be divisible by 3.

This significantly limits the search space.

Citrix is online now   Reply With Quote
Old 2023-03-11, 04:17   #8
SmartMersenne
 
Sep 2017

20710 Posts
Default

How large (in terms of number of digits) are the best solutions people found so far (for both problems)?
SmartMersenne is offline   Reply With Quote
Old 2023-03-11, 05:59   #9
tgan
 
Jul 2015

1010112 Posts
Default HOW can we know

How can we know that a solution is the optimal
tgan is offline   Reply With Quote
Old 2023-03-11, 09:48   #10
SmartMersenne
 
Sep 2017

32·23 Posts
Default

Quote:
Originally Posted by tgan View Post
How can we know that a solution is the optimal
By checking with your friends
SmartMersenne is offline   Reply With Quote
Old 2023-03-11, 17:43   #11
uau
 
Jan 2017

2·3·29 Posts
Default

Quote:
Originally Posted by tgan View Post
How can we know that a solution is the optimal
Do an exhaustive search of all possible solutions.
uau is offline   Reply With Quote
Reply

Thread Tools


Similar Threads
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

All times are UTC. The time now is 03:02.


Sat Sep 30 03:02:38 UTC 2023 up 17 days, 44 mins, 0 users, load averages: 0.78, 0.91, 0.91

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2023, Jelsoft Enterprises Ltd.

This forum has received and complied with 0 (zero) government requests for information.

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation.
A copy of the license is included in the FAQ.

≠ ± ∓ ÷ × · − √ ‰ ⊗ ⊕ ⊖ ⊘ ⊙ ≤ ≥ ≦ ≧ ≨ ≩ ≺ ≻ ≼ ≽ ⊏ ⊐ ⊑ ⊒ ² ³ °
∠ ∟ ° ≅ ~ ‖ ⟂ ⫛
≡ ≜ ≈ ∝ ∞ ≪ ≫ ⌊⌋ ⌈⌉ ∘ ∏ ∐ ∑ ∧ ∨ ∩ ∪ ⨀ ⊕ ⊗ 𝖕 𝖖 𝖗 ⊲ ⊳
∅ ∖ ∁ ↦ ↣ ∩ ∪ ⊆ ⊂ ⊄ ⊊ ⊇ ⊃ ⊅ ⊋ ⊖ ∈ ∉ ∋ ∌ ℕ ℤ ℚ ℝ ℂ ℵ ℶ ℷ ℸ 𝓟
¬ ∨ ∧ ⊕ → ← ⇒ ⇐ ⇔ ∀ ∃ ∄ ∴ ∵ ⊤ ⊥ ⊢ ⊨ ⫤ ⊣ … ⋯ ⋮ ⋰ ⋱
∫ ∬ ∭ ∮ ∯ ∰ ∇ ∆ δ ∂ ℱ ℒ ℓ
𝛢𝛼 𝛣𝛽 𝛤𝛾 𝛥𝛿 𝛦𝜀𝜖 𝛧𝜁 𝛨𝜂 𝛩𝜃𝜗 𝛪𝜄 𝛫𝜅 𝛬𝜆 𝛭𝜇 𝛮𝜈 𝛯𝜉 𝛰𝜊 𝛱𝜋 𝛲𝜌 𝛴𝜎𝜍 𝛵𝜏 𝛶𝜐 𝛷𝜙𝜑 𝛸𝜒 𝛹𝜓 𝛺𝜔