This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A052360 #27 Feb 16 2025 08:32:41 %S A052360 4,3,3,5,4,4,3,5,5,4,3,6,6,8,8,7,7,9,8,8,6,10,10,12,11,11,10,12,12,11, %T A052360 6,10,10,12,11,11,10,12,12,11,5,9,9,11,10,10,9,11,11,10,5,9,9,11,10, %U A052360 10,9,11,11,10,5,9,9,11,10,10,9,11,11,10,7,11,11,13,12,12,11,13 %N A052360 Number of characters in the English name of n, including spaces and hyphens. %C A052360 See A007005 for the French analog, and A167507 for the "count letters only" variant (analog of A005589). - _M. F. Hasler_, Sep 20 2014 %H A052360 Tanar Ulric, <a href="/A052360/b052360.txt">Table of n, a(n) for n = 0..10000</a> %H A052360 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/Number.html">Number</a> %e A052360 Note that a(373373) = 64 whereas A005589(373373) = 56. %p A052360 a:= n-> length(convert(n, english)): %p A052360 seq(a(n), n=0..100); # _Alois P. Heinz_, Jul 30 2023 %o A052360 (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"); %o A052360 return( Str( English(n[1])," ",pot[i+1], if( n[2], Str(" ",English(n[2])), "")))); %o A052360 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], %o A052360 Str([ "twenty", "thirty", "forty", "fifty", "sixty", "seventy", "eighty", "ninety" ][n\10-1], if( n%10, Str("-",English(n%10)),"")))} %o A052360 A052360(n)=#English(n) \\ _M. F. Hasler_, Jul 26 2011 %o A052360 (Python) %o A052360 from num2words import num2words %o A052360 def a(n): return len(num2words(n).replace(" and", "").replace(chr(44), "")) %o A052360 print([a(n) for n in range(78)]) # _Michael S. Branicky_, Jul 12 2022 %Y A052360 Cf. A005589, A052362-A052363. %K A052360 nonn,word,nice,easy %O A052360 0,1 %A A052360 _Allan C. Wechsler_, Mar 07 2000 %E A052360 Minor edits by _Ray Chandler_, Jul 22 2009