A302503
Lexicographically first sequence of distinct terms such that any set of eight successive digits can be reordered as {d, d+1, d+2, d+3, d+4, d+5, d+6, d+7}, d being the smallest of the eight digits.
Original entry on oeis.org
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 23, 45, 67, 81, 234, 56, 70, 12, 34, 567, 89, 2345, 678, 92, 345, 6781, 23456, 78, 123, 456, 701, 234567, 812, 3456, 781, 2345670, 1234, 5670, 12345, 670, 123456, 789, 2345678, 923, 4567, 892, 34567, 8123, 45670, 1234567, 8923, 45678, 9234, 5678, 92345, 6789, 23456781, 23456701
Offset: 1
Terms a(1) to a(10) are obvious;
a(11) is 23 because 23 is the smallest integer not yet in the sequence such that the elements of the sets {3,4,5,6,7,8,9,2} and {4,5,6,7,8,9,2,3} are eight consecutive digits;
a(12) is 45 because 45 is the smallest integer not yet in the sequence such that the elements of the sets {5,6,7,8,9,2,3,4} and {6,7,8,9,2,3,4,5} are eight consecutive digits;
a(13) is 67 because 67 is the smallest integer not yet in the sequence such that the elements of the sets {7,8,9,2,3,4,5,6} and {8,9,2,3,4,5,6,7} are eight consecutive digits;
etc.
Cf.
A228326 for the same idea with sets of two digits,
A302173 (sets of three digits),
A302499 (sets of four digits),
A302500 (sets of five digits),
A302501 (sets of six digits) and
A302502 (sets of seven digits).
-
a, runLength = [i for i in range(10)], 8
def helper(s, k, l, a):
if k not in a: return k
return min([helper(s[(2-l):]+str(i), int(str(k)+str(i)), l, a) for i in range(10) if (k!=0 or i!=0) and s.find(str(i))==-1 and (all(d[n]+1==d[n+1] for n in range(l-1)) if (d:=sorted([int((s+str(i))[n]) for n in range(l)])) else False)])
while len(a)<100: a.append(helper(("".join(map(str, a)))[(1-runLength):], 0, runLength, a))
print(a) # Dominic McCarty, Feb 03 2025
A302504
Lexicographically first sequence of distinct terms such that any set of nine successive digits can be reordered as {d, d+1, d+2, d+3, d+4, d+5, d+6, d+7, d+8}, d being the smallest of the nine digits.
Original entry on oeis.org
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 12, 34, 56, 78, 91, 23, 45, 67, 80, 123, 456, 780, 1234, 567, 89, 12345, 678, 912, 345, 6780, 123456, 789, 1234567, 801, 234, 5678, 9123, 4567, 891, 2345, 6789, 12345678, 91234, 56780, 123456780, 123456789
Offset: 1
Terms a(1) to a(10) are obvious;
a(11) is 12 because 12 is the smallest integer not yet in the sequence such that the elements of the sets {2,3,4,5,6,7,8,9,1} and {3,4,5,6,7,8,9,1,2} are nine consecutive digits;
a(12) is 34 because 34 is the smallest integer not yet in the sequence such that the elements of the sets {4,5,6,7,8,9,1,2,3} and {5,6,7,8,9,1,2,3,4} are nine consecutive digits;
a(13) is 56 because 56 is the smallest integer not yet in the sequence such that the elements of the sets {6,7,8,9,1,2,3,4,5} and {7,8,9,1,2,3,4,5,6} are nine consecutive digits;
etc.
Cf.
A228326 for the same idea with sets of two digits,
A302173 (sets of three digits),
A302499 (sets of four digits),
A302500 (sets of five digits),
A302501 (sets of six digits),
A302502 (sets of seven digits) and
A302503 (sets of eight digits).
-
a, runLength = [i for i in range(10)], 9
def helper(s,k,l,a):
if k not in a: return k
return min([helper(s[(2-l):]+str(i),int(str(k)+str(i)),l,a) for i in range(10) if (k!=0 or i!=0) and s.find(str(i))==-1 and (all(d[n]+1==d[n+1] for n in range(l-1)) if (d:=sorted([int((s+str(i))[n]) for n in range(l)])) else False)])
while len(a)<100: a.append(helper(("".join(map(str,a)))[(1-runLength):],0,runLength,a))
print(a) # Dominic McCarty, Feb 02 2025
Showing 1-2 of 2 results.
Comments