login
A108017
Position of integer n in the list of first n natural numbers written out in English (without "and") and arranged in alphabetical order.
2
1, 2, 2, 1, 1, 4, 4, 1, 4, 8, 2, 11, 10, 5, 3, 11, 10, 2, 9, 19, 20, 21, 21, 20, 20, 23, 23, 20, 23, 17, 18, 19, 19, 18, 18, 21, 21, 18, 21, 6, 7, 8, 8, 7, 7, 10, 10, 7, 10, 5, 6, 7, 7, 6, 6, 9, 9, 6, 9, 35, 36, 37, 37, 36, 36, 39, 39, 36, 39, 33, 34, 35, 35, 34, 34, 37, 37, 34, 37, 3, 4, 5, 5
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
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
Cf. A005589, A214095 (in French).
Sequence in context: A053390 A140643 A331409 * A293208 A247364 A301895
KEYWORD
nonn,word
AUTHOR
Lekraj Beedassy, May 31 2005
EXTENSIONS
a(21) onward corrected by Michael S. Branicky, Dec 28 2025
STATUS
approved