HP 50g: Programming Problem: Integer Partition in Palindromic Integers
|
02-10-2018, 08:06 PM
Post: #16
|
|||
|
|||
RE: HP 50g: Programming Problem: Integer Partition in Palindromic Integers
Hello, Gerald H, I modified the program, now it checks if the integer is a power of 10 at the beginning of the REPEAT portion of the program, with an IFTE command, the program is now 201 bytes long and the check-sum is # 480h
« WHILE DUP 9 > REPEAT DUP →STR SIZE OVER 1 - →STR SIZE == « DUP →STR DUPDUP SIZE 2 / SWAP 1 PICK3 SUB DUPDUP 1 5 PICK FLOOR SUB SREV + 4 ROLL OVER < { DROP OBJ→ 1 - →STR DUP 1 4 ROLL FLOOR SUB SREV + } { NIP NIP } IFTE OBJ→ SWAP OVER - » { 1 - 1 } IFTE END » |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: