HP 50g: Programming Problem: Integer Partition in Palindromic Integers - Printable Version +- HP Forums (https://www.hpmuseum.org/forum) +-- Forum: HP Calculators (and very old HP Computers) (/forum-3.html) +--- Forum: General Forum (/forum-4.html) +--- Thread: HP 50g: Programming Problem: Integer Partition in Palindromic Integers (/thread-10026.html) Pages: 1 2 |
RE: HP 50g: Programming Problem: Integer Partition in Palindromic Integers - Gerald H - 02-13-2018 09:31 PM Meanwhile here's a shorter version of the programme: Size: 261.5 Bytes CkSum: # E377h Code: « 0 SWAP RE: HP 50g: Programming Problem: Integer Partition in Palindromic Integers - Juan14 - 02-18-2018 01:50 AM Hello Gerald H, in my previous program I wanted to see if I can have an IFTE structure inside another one and it did work. The problem with comparing the two strings got me thinking that it is not necessary to compare the hole number but just last half of it. Now the program is 195 bytes and the check-sum is # 4007h. Thanks for the remarks that help improve the program. Code: « RE: HP 50g: Programming Problem: Integer Partition in Palindromic Integers - Gerald H - 02-18-2018 06:19 AM I have found two numbers that cause problems for the programme. 5186197216518619721 causes the programme to go into an infinite loop & 5936136460563669585 returns 5936136459593613645 970049700 6161 77 2 three of which are not palindromes. RE: HP 50g: Programming Problem: Integer Partition in Palindromic Integers - Gerald H - 02-19-2018 04:39 PM Here is my version of Juan14's programme, now gives correct answers for any positive integer: SIZE: 279. CKSM: # 55A3h Code: « 0. SWAP RE: HP 50g: Programming Problem: Integer Partition in Palindromic Integers - Gerald H - 02-25-2018 03:41 PM Good news! Here is a proof that any integer can be partitioned in THREE palindromes: https://arxiv.org/pdf/1602.06208v1.pdf So the challenge is to produce a programme that returns such tripartite partitions. |