cp's OEIS Frontend

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.

A345015 Starting with 1, the next entry is the next higher odd integer whose spelling in English comes lexicographically earlier.

Original entry on oeis.org

1, 5, 11, 81, 85, 801, 805, 811, 881, 885, 808001, 808005, 808011, 808081, 808085, 808801, 808805, 808811, 808881, 808885, 808000001, 808000005, 808000011, 808000081, 808000085, 808000801, 808000805, 808000811, 808000881, 808000885, 808808001, 808808005
Offset: 1

Views

Author

Paul Erickson, Sep 15 2021

Keywords

Comments

From Michael S. Branicky, Jan 04 2022: (Start)
The restriction to odd numbers prevents the trivial sequence 1, 4, 5, 8 noted in A180301.
US English is used, so 101 is "one hundred one".
Alphabetical order is with commas removed, but with spaces and hyphens included, e.g., 8800 ("eight thousand eight hundred") precedes 8018 ("eight thousand eighteen").
In extending the sequence to large numbers, the "American system" (Weisstein link), also known as the "short scale" (Wikipedia link), was used.
a(41) = 8000000001 ("eight billion one"). The highest term is a(80) = 8*10^9 + a(40) = 8808808885 ("eight billion eight hundred eight million eight hundred eight thousand eight hundred eighty-five"). See link to US English names of terms. (End)

Examples

			The first term 1 ("one") is preceded in lexicographic order first by odd number 5 ("five"), which is preceded by odd number 11 ("eleven"), and so on.
		

Crossrefs

Cf. A180301.

Programs

  • Mathematica
    list = {1};
    Do [ If  [ -1 ==
        AlphabeticOrder [   IntegerName [ list[[-1]] , "Words"] ,
         IntegerName [ i, "Words" ] ], AppendTo [ list, i] ], {i, 1, 10^5,
        2}];
    list
  • Python
    from num2words import num2words
    def n2w(n):
        return num2words(n).replace(" and", "") .replace(chr(44), "")
    def afind(startfrom=1, limit=float('inf')):
        last, t = startfrom, startfrom + 1 + startfrom%2
        if startfrom%2 == 1:
            print(startfrom, end=", ")
        while t <= limit:
            target = n2w(last)
            while n2w(t) >= target:
                t += 2
                if t > limit: return
            last = t
            print(t, end=", ")
    afind(limit=10**6) # Michael S. Branicky, Jan 04 2022

Formula

From Michael S. Branicky, Jan 04 2022: (Start)
a(10+i) = 808000 + a(i), for i in 1..10.
a(20+i) = 808000000 + a(i), for i in 1..20.
a(40+i) = 8000000000 + a(i), for i in 1..40. (End)

Extensions

a(11) and beyond from Michael S. Branicky, Jan 04 2022