A143789 Lightest finite monotonically increasing sequence obtained by chunking an 18-digit Skolem-Langford integer (see A108116). There are d digits between two d's in the sequence.
4, 5, 6, 7, 8, 41, 51, 63, 72, 83, 200
Offset: 1
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.
def A132291gen(): # SL() is in A108116 for numd in range(1, 11): dset = ("0123456789")[:numd] s = [0 for _ in range(2*numd)] for an in sorted(SL(dset, s)): yield an for n, an in enumerate(A132291gen(), start=1): print(n, an) # Michael S. Branicky, Dec 14 2020
41312432 is a term since both 4's are separated by four digits, the 1's by one, the 3's by three, the 2's by two. Every digit from 1 to 4 is present.
def afull(): # SL() is in A108116 alst = [] for d in range(1, 11): for b in range(11-d): dset = ("0123456789")[b:b+d] s = [0 for _ in range(2*d)] for an in sorted(SL(dset, s)): alst.append(an) return sorted(alst) print(afull()[:22]) # Michael S. Branicky, Oct 14 2022
a(1) = 2002: in 2002 the closest duplicate of the first 2 is 2 positions away to the right, the closest duplicate of the first 0 is 0 position away to the right, the closest duplicate of the second 0 is 0 position away to the left, the closest duplicate of the second 2 is 2 positions away to the left; a(2) = 30003: in 30003 the closest duplicate of the first 3 is 3 positions away to the right, the closest duplicate of the first 0 is 0 position away to the right, the closest duplicate of the second 0 is 0 position away (either to the left or to the right), the closest duplicate of the third 0 is 0 position away to the left, the closest duplicate of the second 3 is 3 positions away to the left; a(13) = 2312131: if you pick any digit 1, the closest duplicate of this 1 is 1 position away (either to the left or to the right), if you pick any 2, the closest duplicate of this 2 is 2 positions away, if you pick any 3, the closest duplicate of this 3 is 3 positions away, etc.
is_A339803(n)={!for(i=1,#n=digits(n), (i>n[i]+1 && n[i-n[i]-1]==n[i])||(i+n[i]<#n && n[i+n[i]+1]==n[i])||return; for(j=max(i-n[i],1), min(i+n[i],#n), n[j]==n[i] && j!=i && return))} \\ M. F. Hasler, Dec 19 2020
def nn(ti, t, s): li = s.rfind(t, 0, max(ti, 0)) ri = s.find(t, min(ti+1, len(s)), len(s)) if li==-1: li = -11 if ri==-1: ri = len(s)+11 return min(ti-li, ri-ti) - 1 def ok(n): strn = str(n) if any(strn.count(c)==1 for c in set(strn)): return False for i, c in enumerate(strn): if nn(i, c, strn) != int(c): return False return True for n in range(6*10**6): if ok(n): print(n, end=", ") # Michael S. Branicky, Dec 17 2020
Comments