Post Reply 
HP 50g: Programming Problem: Integer Partition in Palindromic Integers
02-02-2018, 08:21 AM (This post was last modified: 02-02-2018 08:23 AM by Gerald H.)
Post: #3
RE: HP 50g: Programming Problem: Integer Partition in Palindromic Integers
A slightly modified version of the programme to remove the occurrence of 0 in the partition if the input ends in 0:

Code:
P24U

Ans►N:
IF Ans<10
THEN
{N}►L1:
ELSE
N:
RUN N2DS:
L2(1):
IF Ans
THEN
{Ans}►L1:
ELSE
CLRVAR L1:
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-02-2018 08:21 AM



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