OFFSET
0,22
LINKS
Reinhard Zumkeller, Table of n, a(n) for n = 0..10000
Robert G. Wilson v, English names for the numbers from 0 to 11159 without spaces or hyphens
EXAMPLE
n = 19 -> nineteen: a(19) = #{nine} = 1;
n = 20 -> twenty: a(20) = #{} = 0;
n = 21 -> twentyone: a(21) = #{one, twenty} = 2.
PROG
(Python)
from num2words import num2words
from functools import cache
@cache
def n2w(n):
map = {ord(c): None for c in "-, "}
return num2words(n).replace(" and", "").translate(map)
def a(n): wn = n2w(n); return sum(1 for i in range(n) if n2w(i) in wn)
print([a(n) for n in range(105)]) # Michael S. Branicky, Feb 13 2024
CROSSREFS
KEYWORD
nonn,word
AUTHOR
Reinhard Zumkeller, Apr 12 2009
STATUS
approved