Post Reply 
(50G) Characteristic Function of OEIS A053432
10-25-2015, 06:47 AM (This post was last modified: 06-15-2017 01:43 PM by Gene.)
Post: #1
(50G) Characteristic Function of OEIS A053432
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
  ;
;
Find all posts by this user
Quote this message in a reply
Post Reply 




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