Post Reply 
HP 50g: Programming Problem: Integer Partition in Palindromic Integers
02-04-2018, 08:13 AM
Post: #4
RE: HP 50g: Programming Problem: Integer Partition in Palindromic Integers
Here a corrected version for the 38G:

Code:
N2DS

 Ans►T:
 SYSEVAL 532278:
 FOR I=1 TO INT(LOG(T)+1) STEP 1;
  T MOD 10:
 CONCAT(L2,{Ans})►L2:
 INT(T/10)►T:
 END:

P24U

Ans►N:
 IF Ans<10
 THEN
 {N}►L1:
 ELSE
 N:
 RUN N2DS:
 L2(1):
 IF Ans
 THEN
 {Ans}►L1:
 ELSE
 SYSEVAL 532268:
 END:
 SUB L2;L2;2;12:
 FOR I=1 TO SIZE(L2) STEP 1;
  L2(I):
 Ans►H:
 IF H
 THEN 
 IF H>1
 THEN
 11-H:
 END:
 CONCAT(L1,{Ans,10^I*H-Ans})►L1:
 END:
 END:
 END:
 REVERSE(SORT(L1))►L1:
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 - Gerald H - 02-04-2018 08:13 AM



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