login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A371478
Numbers k for which k swaps are needed to bubble-sort the US English number name of k.
1
2, 17, 21, 25
OFFSET
1,1
COMMENTS
No swaps involve hyphens or spaces.
Only four such numbers < 100 have this property: are there more?
In French, only three such numbers are known: 1, 14, 23.
For number names up to one million, the number of swaps does not exceed 712. - Hans Havermann, Mar 25 2024
There are no more terms. Computationally, there are none < 10^9. If the name of n has k letters, a(n) <= k*(k-1)/2 from the properties of bubble sort. Also, if 1000^(e-1) <= n < 1000^e, then k <= 41*e, where the loose upper bound comes from "threehundredseventythree" and "quattuordecillion" considering all terms up to 10^66 using English names of large numbers (see Wikipedia link). Thus, a(n) <= 820*e^2 <= 1000^(e-1) for e >= 3. Similar bounds can be derived for extended naming schemes. - Michael S. Branicky, Mar 26 2024
LINKS
Eric Angelini and Nicolas Graner, More bubble sorting, personal blog, March 2024.
EXAMPLE
2 is a term since "two" requires 2 swaps of adjacent letters to sort into ascending alphabetical order: TWO -> TOW -> OTW.
CROSSREFS
KEYWORD
base,nonn,word,fini,full
AUTHOR
Eric Angelini and Nicolas Graner, Mar 25 2024
STATUS
approved