OFFSET
1,2
COMMENTS
In going to higher terms, we use the conventions in A005589: spaces, hyphens and commas are removed before sorting. Thus, a(800) = 3 from EIGHT, EIGHTEEN, EIGHTHUNDRED, ..., not 2 from EIGHT, EIGHT HUNDRED, EIGHTEEN, ... . - Michael S. Branicky, Dec 28 2025
LINKS
Michael S. Branicky, Table of n, a(n) for n = 1..10000
EXAMPLE
a(19) = 9 because of the ordered list: EIGHT, EIGHTEEN, ELEVEN, FIFTEEN, FIVE, FOUR, FOURTEEN, NINE, NINETEEN, ..., TWELVE, TWO.
a(21) = 20 because of the ordered list: EIGHT, ..., TWENTY, TWENTYONE, TWO.
PROG
(Python)
from num2words import num2words
from bisect import bisect, insort
from itertools import count, islice
def agen(): # generator of terms
s = [""]
for n in count(1):
sn = "".join(c for c in num2words(n).replace(" and", "") if c.isalpha())
an = bisect(s, sn)
insort(s, sn)
yield an
print(list(islice(agen(), 83))) # Michael S. Branicky, Dec 28 2025
CROSSREFS
KEYWORD
nonn,word
AUTHOR
Lekraj Beedassy, May 31 2005
EXTENSIONS
a(21) onward corrected by Michael S. Branicky, Dec 28 2025
STATUS
approved
