Post Reply 
HP 50g: Programming Problem: Integer Partition in Palindromic Integers
02-05-2018, 12:22 AM
Post: #5
RE: HP 50g: Programming Problem: Integer Partition in Palindromic Integers
This program returns the Palindromic Integers of an integer's partition to the stack. The idea is simple, but the program got somehow complicated.

«
WHILE DUP 10 >
REPEAT
DUP →STR DUPDUP SIZE 2 / SWAP 1 PICK3 SUB
DUPDUP 1 5 PICK FLOOR SUB SREV +
4 ROLL OVER <
{ DROP DUP OBJ→ 1 - →STR DUP ROT SIZE SWAP SIZE
‹ -.5 * ROT + OVER 1 ROT FLOOR SUB SREV + }
{ NIP NIP } IFTE OBJ→ SWAP OVER -
END DUP 10 == { DROP 9 1} IFT
»
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: HP 50g: Programming Problem: Integer Partition in Palindromic Integers - Juan14 - 02-05-2018 12:22 AM



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