login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A377912
Numbers such that every even digit except the last is immediately followed by a strictly larger digit.
7
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117
OFFSET
1,3
COMMENTS
In other words, numbers that do not contain a pair of successive digits i, j where i is even and j <= i.
MATHEMATICA
A377912Q[k_] := Count[Partition[IntegerDigits[k], 2, 1], {i_, j_} /; EvenQ[i] && j <= i] == 0;
Select[Range[0, 300], A377912Q] (* Paolo Xausa, Nov 28 2024 *)
PROG
(Python)
def ok(n):
s = str(n)
return not any(s[i] in "2468" and s[i+1] <= s[i] for i in range(len(s)-1))
print([k for k in range(0, 118) if ok(k)]) # Michael S. Branicky, Nov 28 2024
CROSSREFS
The complement of A347298. Cf. A342042, A377914, A377917, A377918.
Sequence in context: A247751 A059962 A057605 * A326872 A110548 A249815
KEYWORD
nonn,base
AUTHOR
N. J. A. Sloane, Nov 27 2024, with thanks to Paolo Xausa for correcting the initial definition.
EXTENSIONS
Added 0 to match A342042, and replaced negative definition by a positive one. - N. J. A. Sloane, Nov 29 2024
STATUS
approved