Post Reply 
Tripartite Palindromic Partition of Integer (HP 50g) Challenge
05-16-2023, 10:14 AM
Post: #117
RE: Tripartite Palindromic Partition of Integer (HP 50g) Challenge
A separate programme for determining the type (as defined in the proof) of an integer:

Code:
Size: 357.5

CkSum: # 2472h

::
  CK1&Dispatch
  # FF
  ::
    FPTR2 ^Z>S
    DUPLEN$
    DUP
    BINT6
    #>
    NcaseSIZEERR
    ONE_DO
    DUPINDEX@
    DUP
    BINT4
    #=
    IT
    ::
      ISTOP@
      SWAP
      ISTOPSTO
    ;
    SUB$1#
    BINT48
    #-SWAP
    LOOP
    DROP3PICK
    BINT2
    #>case
    ::
      SWAPDROP
      #1+
      3UNROLL
      #+
      #-
      #0=case
      "A2"
      "A1"
    ;
    4PICK
    BINT1
    #>case
    ::
      ROTROT2DROP
      #2+
      #-
      #0=case
      "A4"
      "A3"
    ;
    4ROLLDROP
    3PICK
    #0=
    3PICK
    BINT4
    #<
    AND
    3PICK3PICK
    #-
    #0<>
    ANDcase
    ::
      3DROP
      "A5"
    ;
    3PICK
    #0=
    3PICK
    BINT3
    #<
    ANDcase
    ::
      3DROP
      "A6"
    ;
    ROTDROP
    OVER
    BINT3
    #>
    3PICK3PICK
    #-
    #0<>
    AND
    case2drop
    "B1"
    OVER
    BINT2
    #>
    3PICK3PICK
    #-
    #0=
    AND
    case2drop
    "B2"
    DUP#0=
    3PICK
    BINT2
    #<
    AND
    case2drop
    "B3"
    DUP#0=
    3PICK
    DUP
    #3=
    SWAP
    #2=
    OR
    AND
    case2drop
    "B4"
    #0<>
    SWAP
    BINT3
    #<
    ANDcase
    "B5"
    "B6"
  ;
;
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Tripartite Palindromic Partition of Integer (HP 50g) Challenge - Gerald H - 05-16-2023 10:14 AM



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