HP 50g: Programming Problem: Integer Partition in Palindromic Integers
|
02-01-2018, 11:20 AM
(This post was last modified: 02-07-2018 05:38 PM by Gerald H.)
Post: #2
|
|||
|
|||
RE: HP 50g: Programming Problem: Integer Partition in Palindromic Integers
Edited to "39g programme" from "38G programme" - sorry for the error.
Well, not much progress made on this, unless members are keeping their solutions secret. Meanwhile I have produced a complete solution for the 39g, although I do not claim that the partitions share the characteristic of having a minimum number of elements in the respective palindromic partition. The 39g programme has one sub programme, N2DS, which for natural number input Ans produces a list of digits in list L2, eg for input 23405 L2 will contain {5,0,4,3,2} which may in itself be useful. Code: N2DS The main programme, P24U, which for natural number input Ans produces a list of the palindromic partition members in descending order in list L1. eg For input 987654321678 L1 will contain Code: {899999999998,79999999997,6999999996,599999995,49999994,3999993,299992,19991,999,595,66,9,8,8,7,6,5,5,4,4,3,2,1} Code: P24U As the 39g is limited to 12 digit integers, the above programme solves the problem completely on that machine. However, as the algorithm produces two elements of the partition for each digit, the method becomes impractical on the 49G for , say, 6,000 digit numbers. I again encourage members to apply themselves to this interesting, if unimportant, problem. |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)