Post Reply 
Tripartite Palindromic Partition of Integer (HP 50g) Challenge
02-25-2023, 02:37 AM (This post was last modified: 03-12-2023 01:22 AM by 2old2randr.)
Post: #27
RE: Tripartite Palindromic Partition of Integer (HP 50g) Challenge
Edit: A complete implementation of the algorithms in the paper (incl. 2-6 digit cases) is attached to a later post. Peruna's code as included here has bugs that do not return correct results for some numbers.

Here is my implementation (in User RPL) of the algorithms in the paper by Cilleruelo, Luca and Baxter. Although I did code their algorithms for "small" numbers (less than 7 digits), I've used Peruna's solution posted earlier for these cases since it is much faster for 5 and 6 digit numbers.

The code takes 65 minutes (measured using TICKS) to compute solutions for the range (100000000 to 100001102), i.e., 3 seconds per number on average. This is on a physical HP 50g

For 80818283828586878, it produces the solution {71110101010101117, 9500653333560059, 207529484925702} in around 3 seconds.

I've used lists as the number representation but this is possibly not the best way to do it although it does make it easy to verify against the algorithms in the paper.

The main program is in PALIN.txt, the classification routine is NTYPE and the algorithms are in ALGO1-ALGO5. For numbers with less than 7 digits, it falls back on Peruna's code in SMALL.

Edit: I have removed the attachment since the code has gone through many bug fixes and this is woefully out-of-date. The fixed code is attached to a later post.
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 - 2old2randr - 02-25-2023 02:37 AM



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