%I #44 Aug 05 2021 10:38:09
%S 8,5,4,9,1,7,6,3,2,0,18,80,88,85,84,89,81,87,86,83,82,11,15,50,58,55,
%T 54,59,51,57,56,53,52,40,48,45,44,49,41,47,46,43,42,14,19,90,98,95,94,
%U 99,91,97,96,93,92,17,70,78,75,74,79,71,77,76,73,72
%N 1-digit numbers arranged in alphabetical order, then the 2-digit numbers arranged in alphabetical order, then the 3-digit numbers, etc.
%C This sequence uses standard US English names for numbers. - _Daniel Forgues_, May 11 2016
%C For example, standard US English writes out the number 101 as "one hundred one", whereas standard UK English writes it out as "one hundred and one" (see Links). - _Jon E. Schoenfield_, Dec 25 2016
%C Alphabetical order is with spaces removed/disregarded, else, as a first example, a(1003)=8018 ("eight thousand eighteen") would follow a(1004)=8800 ("eight thousand eight hundred") among others. - _Michael S. Branicky_, Aug 05 2021
%H <a href="/A000052/b000052.txt">Table of n, a(n) for n = 1..10000</a>
%H Wikipedia, <a href="https://en.wikipedia.org/wiki/101st_United_States_Congress">101st United States Congress</a>
%H Wiktionary, <a href="https://en.wiktionary.org/wiki/one_hundred_one">one hundred one</a> (US)
%H Wiktionary, <a href="https://en.wiktionary.org/wiki/one_hundred_and_one">one hundred and one</a> (UK)
%e eight, five, four, nine, one, seven, six, three, two, zero, eighteen, etc.
%e Examples of spelling convention used for values above 99:
%e 400: "four hundred"
%e 726: "seven hundred twenty-six"
%e 1992: "one thousand nine hundred ninety-two"
%e 2202: "two thousand two hundred two"
%e 101001: "one hundred one thousand one"
%e 726726: "seven hundred twenty-six thousand seven hundred twenty-six"
%e 101000001: "one hundred one million one"
%p V:= [[$0..9],[$10..99],[$100..999]]:
%p seq(op(V[i][sort(map(convert,V[i],english,'And'),
%p output=permutation)]),i=1..3); # _Robert Israel_, Jun 17 2016
%t Flatten@Join[{8, 5, 4, 9, 1, 7, 6, 3, 2, 0}, SortBy[Range[10^#, 10^(# + 1) - 1], StringReplace[IntegerName[#, "Words"], "," -> ""] &] & /@ Range[3]] (* _Davin Park_, Dec 25 2016 *)
%o (Python)
%o from num2words import num2words
%o def n2w(n):
%o return num2words(n).replace(" and", "").replace(",", "").replace(" ", "")
%o def agen(maxdigits):
%o for d in range(1, maxdigits+1):
%o yield from sorted(range(10**(d-1)-(d==1), 10**d), key=lambda x: n2w(x))
%o print([an for an in agen(2)]) # _Michael S. Branicky_, Aug 05 2021
%Y Cf. A001058.
%K nonn,base,word
%O 1,1
%A _N. J. A. Sloane_
%E Corrected by _Davin Park_, Dec 25 2016