A239137 The sequence S = a(1), a(2), ... is defined by a(1)=1, if d,e,f are consecutive digits then we do not have d <= e <= f, and S is always extended with the smallest integer not yet present in S.
1, 2, 10, 3, 12, 13, 14, 15, 4, 5, 16, 17, 6, 7, 18, 19, 8, 9, 20, 21, 30, 31, 32, 40, 41, 42, 43, 22, 102, 103, 23, 24, 25, 26, 27, 28, 29, 33, 104, 34, 35, 36, 37, 38, 39, 44, 105, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 60, 61, 62, 63, 64, 65, 70, 71, 72, 73
Offset: 1
References
- Eric Angelini, Posting to Sequence Fans Mailing List, Sep 28 2013
Links
- Eric Angelini, Less than <, Equal to =, Greater than > (see sequence Sg)
- Eric Angelini, Less than <, Equal to =, Greater than > [Cached copy, with permission of the author]
Crossrefs
Programs
-
Python
is_ok = lambda s: not any(s[i-2] <= s[i-1] <= s[i] for i in range(2, len(s))) terms, appears, digits = [1], {1}, '1' for i in range(100): t = 1 while not( t not in appears and is_ok(digits + str(t)) and t % 100 not in [0, 1, 11] ): t += 1 terms.append(t); appears.add(t); digits = digits + str(t) digits = digits[-2:] print(terms) # Gleb Ivanov, Dec 06 2021
Extensions
a(56) corrected by Gleb Ivanov, Dec 17 2021
Comments