Post Reply 
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
  DO SWAP 1 + SWAP DUPDUP →STR DUP SREV DUP2 SAME
    IF
    THEN DROP2
    ELSE OBJ→ 1 SAME
      IF
      THEN DROP2 1 - SWAP 1 + 1 1
      ELSE 1. OVER SIZE 2. / DUP IP 5. ROLLD SUB DUPDUP 1. 6. PICK SUB SREV + OBJ→ ROT OVER <
        IF
        THEN DROP OBJ→ 1 - →STR DUP 1. 4. PICK SUB SREV + OBJ→ DUP
        END UNROT DROP2
      END
    END DUP 4 ROLLD - DUP NOT
  UNTIL
  END DROP DUPDUP 2. + ROLLD →LIST SWAP →TAG
»
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-13-2018 09:31 PM



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