Post Reply 
(49G) OEIS A002113: Palindromes in Base 10 in Natural Order
01-21-2018, 03:19 PM
Post: #1
(49G) OEIS A002113: Palindromes in Base 10 in Natural Order
For natural number entry N the programme returns the Nth palindrome.

For info on palindromes see

https://oeis.org/A002113

For background to the programme see

http://www.hpmuseum.org/forum/thread-9922.html

Size: 166.5

CkSum: # A04h

Code:
::
  CK1&Dispatch
  # FF
  ::
    DUP
    ZINT 11
    Z<
    case
    ::
      ZINT 1
      FPTR2 ^RSUBext
    ;
    FPTR2 ^Z>S
    DUP
    CAR$
    CHR_1
    EQUAL
    OVER
    BINT2
    SUB$1#
    BINT48
    #<>
    ANDITE
    ::
      CDR$
      DUP
      '
      xSREV
      EvalNoCK
    ;
    ::
      DUP
      CDR$
      SWAP
      BINT1
      SUB$1#
      BINT49
      #-
      DUP#0=IT
      ::
        DROP
        CDR$
        BINT9
      ;
      #>$
      SWAP&$
      DUP
      '
      xSREV
      EvalNoCK
      CDR$
    ;
    &$
    FPTR2 ^S>Z
  ;
;
Find all posts by this user
Quote this message in a reply
Post Reply 




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