OFFSET
0,1
COMMENTS
See A007005 for the French analog, and A167507 for the "count letters only" variant (analog of A005589). - M. F. Hasler, Sep 20 2014
LINKS
Tanar Ulric, Table of n, a(n) for n = 0..10000
Eric Weisstein's World of Mathematics, Number
EXAMPLE
Note that a(373373) = 64 whereas A005589(373373) = 56.
MAPLE
a:= n-> length(convert(n, english)):
seq(a(n), n=0..100); # Alois P. Heinz, Jul 30 2023
PROG
(PARI) English(n, pot=[10^9, "billion", 10^6, "million", 1000, "thousand", 100, "hundred"])={ n>99 && forstep( i=1, #pot, 2, n<pot[i] && next; n=divrem(n, pot[i]); n[1]>999 && error("n >= 1000 ", pot[2], " not yet implemented");
return( Str( English(n[1]), " ", pot[i+1], if( n[2], Str(" ", English(n[2])), ""))));
if( n<20, ["zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine", "ten", "eleven", "twelve", "thirteen", "fourteen", "fifteen", "sixteen", "seventeen", "eighteen", "nineteen"][n+1],
Str([ "twenty", "thirty", "forty", "fifty", "sixty", "seventy", "eighty", "ninety" ][n\10-1], if( n%10, Str("-", English(n%10)), "")))}
A052360(n)=#English(n) \\ M. F. Hasler, Jul 26 2011
(Python)
from num2words import num2words
def a(n): return len(num2words(n).replace(" and", "").replace(chr(44), ""))
print([a(n) for n in range(78)]) # Michael S. Branicky, Jul 12 2022
CROSSREFS
KEYWORD
nonn,word,nice,easy
AUTHOR
Allan C. Wechsler, Mar 07 2000
EXTENSIONS
Minor edits by Ray Chandler, Jul 22 2009
STATUS
approved