login
A342042
When a digit d is even, the next digit is > d.
8
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 30, 13, 14, 50, 15, 16, 70, 17, 18, 90, 19, 23, 24, 51, 25, 26, 71, 27, 28, 91, 29, 31, 32, 33, 34, 52, 35, 36, 72, 37, 38, 92, 39, 45, 46, 73, 47, 48, 93, 49, 53, 54, 55, 56, 74, 57, 58, 94, 59, 67, 68, 95, 69, 75, 76, 77, 78, 96, 79, 89, 97, 98, 99, 101
OFFSET
1,3
COMMENTS
The sequence is always extended with the smallest positive integer not yet present that doesn't lead to a contradiction.
Conjecture: This contains every nonnegative integer except those in A347298. - N. J. A. Sloane, Aug 26 2021
From Sebastian Karlsson, Sep 07 2021: (Start)
Proof of the conjecture: By the definition of the sequence, it cannot contain a number in A347298. Thus, one must show that the converse is also true. That is, if a number is not in A347298, then it is in this sequence (1). Let P be the property of not being in A347298, so that a number n has the property P if every even digit of n (except possibly the last) is followed by a larger digit.
Let m be the smallest number not in B := {a(1), a(2), ..., a(n)} with the property P. If one can show that for every n, there is some n' > n such that a(n') = m, then (1) follows. If a(n') ends with an odd number for any n' > n, then m must appear in the sequence. This is because if a(n') ends with an odd digit, then a(n'+1) is the smallest number not yet appearing in the sequence with the property P.
Suppose that a(n') ends with an even number for every n' > n (2). Let d be an even digit such that S := {k > n | a(k) ends with d} is infinite (such a d must exist if (2) holds). Let k be in S. If a(k+1) ends with an even digit (as we assume) and a(k+1)+1 does not yet appear in the sequence, then a(k'+1) = a(k+1)+1 for k' being the smallest number larger than k in S. As B is finite but S is infinite, B cannot contain {a(k+1)+1 | k in S}. Thus, for some k in S, a(k+1)+1 is a term appearing after a(n). a(k+1)+1 ends with an odd digit, contradicting (2). Q.E.D. (End)
LINKS
N. J. A. Sloane, A Nasty Surprise in a Sequence and Other OEIS Stories, Experimental Mathematics Seminar, Rutgers University, Oct 10 2024, Youtube video; Slides [Mentions this sequence]
PROG
(PARI) See Links section.
(Python)
def cond(s, minfirst):
return all(s[i+1] > s[i] for i in range(len(s)-1) if s[i] in "02468")
def aupton(terms):
alst, seen = [0], {0}
while len(alst) < terms:
d = alst[-1]%10
an = minfirst = (1 - d%2)*(d+1)
stran = str(an)
while an in seen or not cond(stran, minfirst):
an += 1
stran = str(an)
if int(stran[0]) < minfirst:
an = minfirst*10**(len(stran)-1)
alst.append(an); seen.add(an)
return alst
print(aupton(77)) # Michael S. Branicky, Sep 07 2021
CROSSREFS
Cf. A342043, A342044, A342045, A342046 and A342047 (variations on the same idea), A347298.
Sequence in context: A039210 A243020 A061921 * A277650 A341090 A071786
KEYWORD
base,nonn,nice
AUTHOR
Eric Angelini, Feb 26 2021
STATUS
approved