login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A060555 String together the first n numbers in an order which minimizes the result. 2
1, 12, 123, 1234, 12345, 123456, 1234567, 12345678, 123456789, 10123456789, 1011123456789, 101111223456789, 10111121323456789, 1011112131423456789, 101111213141523456789, 10111121314151623456789 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,2
LINKS
PROG
(Python)
from itertools import count, islice
def agen(): # generator of terms
slst = []
for n in count(1):
s, least, argleast = str(n), ":", None
for i in range(len(slst)+1):
t = "".join(slst[:i]) + s + "".join(slst[i:])
if t < least: least, argleast = t, i
slst.insert(argleast, s)
yield int("".join(slst))
print(list(islice(agen(), 16))) # Michael S. Branicky, Nov 29 2022
CROSSREFS
Sequence in context: A057137 A252043 A014824 * A138957 A007908 A262582
KEYWORD
base,easy,nonn
AUTHOR
Henry Bottomley, Apr 02 2001
EXTENSIONS
Incorrect comment removed by Sean A. Irvine, Nov 30 2022
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified July 11 18:48 EDT 2024. Contains 374234 sequences. (Running on oeis4.)