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.

A060554 String together the first n numbers in an order which maximizes the result.

Original entry on oeis.org

1, 21, 321, 4321, 54321, 654321, 7654321, 87654321, 987654321, 98765432110, 9876543211110, 987654321211110, 98765432131211110, 9876543214131211110, 987654321514131211110, 98765432161514131211110
Offset: 1

Views

Author

Henry Bottomley, Apr 02 2001

Keywords

Crossrefs

Programs

  • Python
    from itertools import count, islice
    def agen(): # generator of terms
        slst = []
        for n in count(1):
            s, greatest, argreatest = str(n), "/", None
            for i in range(len(slst)+1):
                t = "".join(slst[:i]) + s + "".join(slst[i:])
                if t > greatest: greatest, argreatest = t, i
            slst.insert(argreatest, s)
            yield int("".join(slst))
    print(list(islice(agen(), 16))) # Michael S. Branicky, Nov 30 2022

Extensions

Incorrect comment removed by Sean A. Irvine, Nov 30 2022