HP Forums

Full Version: (50G) Characteristic Function of OEIS A053432
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
https://oeis.org/A053432

lists the numbers having digits read left to right in alphabetic order in English reading 0 as "zero".

The programme below for integer input returns a 1. if the number is in the sequence A053432, 0. otherwise.

I doubt the programme can be improved & would be pleased to be proven wrong.

Alternative algorithms welcome.

Code:

::
  CK1&Dispatch
  # FF
  ::
    BINT0
    "549176320"
    ROT
    FPTR2 ^Z>S
    DUPLEN$
    ZERO_DO
    2DUP
    CAR$
    BINT1
    POSCHR
    DUP4UNROLL
    5ROLL
    #<ITE
    ExitAtLOOP
    CDR$
    LOOP
    ROTROT2DROP
    NULL$?
    COERCEFLAG
  ;
;
Reference URL's