HP 50g: Programming Problem: Integer Partition in Palindromic Integers
|
02-13-2018, 09:31 PM
Post: #21
|
|||
|
|||
RE: HP 50g: Programming Problem: Integer Partition in Palindromic Integers
Meanwhile here's a shorter version of the programme:
Size: 261.5 Bytes CkSum: # E377h Code: « 0 SWAP |
|||
02-18-2018, 01:50 AM
Post: #22
|
|||
|
|||
RE: HP 50g: Programming Problem: Integer Partition in Palindromic Integers
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: « |
|||
02-18-2018, 06:19 AM
(This post was last modified: 02-18-2018 07:54 AM by Gerald H.)
Post: #23
|
|||
|
|||
RE: HP 50g: Programming Problem: Integer Partition in Palindromic Integers
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. |
|||
02-19-2018, 04:39 PM
(This post was last modified: 02-19-2018 04:42 PM by Gerald H.)
Post: #24
|
|||
|
|||
RE: HP 50g: Programming Problem: Integer Partition in Palindromic Integers
Here is my version of Juan14's programme, now gives correct answers for any positive integer:
SIZE: 279. CKSM: # 55A3h Code: « 0. SWAP |
|||
02-25-2018, 03:41 PM
Post: #25
|
|||
|
|||
RE: HP 50g: Programming Problem: Integer Partition in Palindromic Integers
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. |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 5 Guest(s)