Post Reply 
Tripartite Palindromic Partition of Integer (HP 50g) Challenge
03-24-2023, 01:35 PM
Post: #85
RE: Tripartite Palindromic Partition of Integer (HP 50g) Challenge
Okay, you've been waiting long enough, here's a pre-release of my SysRPL take. There's a lot going on under the hood - I optimized it to hell and back: starting with a CRLIB replacement which is capable of embedding one command inside another (inspired by hints from the Nosy readme). Then there's a lot of callbacks and other runstream and return stack manipulation, and finally I figured out how to merge Algorithms I to IV into a single piece of code which only branches out into four separate code paths after the main loop is done.
As far as I can tell, everything I've implemented so far is working properly. The 107-digit number from post #72 finishes after 4.7733 seconds on real hardware.

Oh, by the way, you can use any base from 5 to 9999. I figured it wouldn't be much extra work, so I just built arbitrary-base support into it from the beginning. The (non-negative) number to be split goes on level 2, the base on level 1, and out come exactly three numbers which are palindromes in the given base. The three are sorted by magnitude, with the largest on level 3, and in cases where the proof's algorithms say that a less palindromes shall be generated, a 0 is used as placeholder.

But there's something I haven't finished yet: 6-digit numbers with a 1 as first digit. Some small parts of that are not yet implemented at all, the rest is awaiting testing (and some more optimization) - and because buggy SysRPL code can cause crashes or even memory corruption, I have replaced all the code responsible for numbers of that form with a placeholder throwing the error #DE1Bh ("To be implemented"). That should be safe enough, though not satisfying yet. Hence, "pre-release".

I'll go more in-depth in a future post, once I wrap up that 6-digit work. The rest of the code I consider finished, so you can dive in if you are feeling brave - both compiled library (L859) and source (as HPDIR) are attached.


Attached File(s)
.hp  Sum3Pal_SysRPL.hp (Size: 3.08 KB / Downloads: 11)
.hp  Sum3Pal_SysRPL_source.hp (Size: 15.75 KB / Downloads: 10)
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Tripartite Palindromic Partition of Integer (HP 50g) Challenge - 3298 - 03-24-2023 01:35 PM



User(s) browsing this thread: 2 Guest(s)