A383501 Nonnegative integers without the digit 9 such that every odd digit except the leftmost is immediately preceded by a larger digit.
0, 1, 2, 3, 4, 5, 6, 7, 8, 10, 12, 14, 16, 18, 20, 21, 22, 24, 26, 28, 30, 31, 32, 34, 36, 38, 40, 41, 42, 43, 44, 46, 48, 50, 51, 52, 53, 54, 56, 58, 60, 61, 62, 63, 64, 65, 66, 68, 70, 71, 72, 73, 74, 75, 76, 78, 80, 81, 82, 83, 84, 85, 86, 87, 88, 100, 102, 104, 106, 108
Offset: 1
Links
- Paolo Xausa, Table of n, a(n) for n = 1..10000
Crossrefs
Programs
-
Mathematica
A383501Q[k_] := FreeQ[#, 9] && FreeQ[Partition[#, 2, 1], {i_, j_?OddQ} /; i <= j] & [IntegerDigits[k]]; Select[Range[0, 200], A383501Q]
-
Python
def ok(n): s = str(n) return "9" not in s and all(d not in "13579" or s[i-1]>d for i, d in enumerate(s) if i > 0) print([k for k in range(134) if ok(k)]) # Michael S. Branicky, Apr 29 2025
Comments