HP Forums

Full Version: (50g) OEIS A056524 & A056525: Palindromes with Even & Odd Number of Digits
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Programme A056524 takes positive integer input N & returns the Nth even-digited palindromic number.

Programme A056525 takes positive integer input N & returns the Nth odd-digited palindromic number.

Together the 2 programmes produce all palindromic integers.

NB: 'EvalNoCK:_sup_ is PTR 25F29 & has been so at least from 1.19-6 on.

A056524

Code:
::
  CK1&Dispatch
  # FF
  ::
    FPTR2 ^Z>S
    DUP
    'EvalNoCK:_sup_
    xSREV
    &$
    FPTR2 ^S>Z
  ;
;

A056525

Code:
::
  CK1&Dispatch
  # FF
  ::
    FPTR2 ^Z>S
    DUP
    'EvalNoCK:_sup_
    xSREV
    CDR$
    &$
    FPTR2 ^S>Z
  ;
;
Reference URL's