OFFSET
1,2
COMMENTS
A permutation of the positive integers.
EXAMPLE
a(1) = 1;
a(2) = 210, because this is the smallest number not yet present in the sequence which, when concatenated with a(1) = 1 -> 1210, contains three consecutive digits 2 > 1 > 0;
a(3) = 2, because this is the smallest number not yet present in the sequence which, when concatenated with a(2) = 210 -> 2102, contains three consecutive digits 2 > 1 > 0;
a(4) = 10, because this is the smallest number not yet present in the sequence which, when concatenated with a(3) = 2 -> 210, contains three consecutive digits 2 > 1 > 0.
PROG
(Python)
is_ok = lambda s: any(s[i-2] > s[i-1] > s[i] for i in range(2, len(s)))
terms, appears = [1], {1}
for i in range(100):
t = 1
while t in appears or not is_ok(str(terms[-1]) + str(t)):
t += 1
terms.append(t); appears.add(t)
print(terms)
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Gleb Ivanov, Dec 06 2021
STATUS
approved