A382938 Nonnegative integers such that every odd digit except the leftmost is immediately preceded by a larger digit.
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 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, 90, 91, 92, 93, 94, 95
Offset: 1
Links
- Paolo Xausa, Table of n, a(n) for n = 1..10000
Crossrefs
Programs
-
Mathematica
A382938Q[k_] := FreeQ[Partition[IntegerDigits[k], 2, 1], {i_, j_?OddQ} /; i <= j]; Select[Range[0, 100], A382938Q]
-
Python
def ok(n): s = str(n) return all(s[i+1] < s[i] for i in range(len(s)-1) if s[i+1] in "13579") print([k for k in range(96) if ok(k)]) # Michael S. Branicky, Apr 14 2025