A346261 Lexicographically earliest sequence of decimal words starting with 10 such that each term has Hamming distance at least 2 from all earlier terms.
10, 21, 32, 43, 54, 65, 76, 87, 98, 100, 111, 122, 133, 144, 155, 166, 177, 188, 199, 201, 212, 220, 234, 245, 253, 267, 278, 286, 302, 313, 324, 330, 341, 356, 368, 375, 389, 397, 403, 414, 425, 431, 440, 452, 469, 496, 504, 515, 523, 536, 542, 550, 561, 579, 605, 616, 627, 638, 649, 651
Offset: 1
Examples
a(1) = 10 by definition. a(2) = 21 because '2' has not yet appeared in the tens place and '1' has not yet appeared in the ones place.
Links
- Michael S. Branicky, Table of n, a(n) for n = 1..10000
- J. H. Conway and N. J. A. Sloane, Lexicographic codes: error-correcting codes from game theory, IEEE Transactions on Information Theory, 32:337-348, 1986.
Crossrefs
Programs
-
Python
def ham(m, n): s, t = str(min(m, n))[::-1], str(max(m, n))[::-1] return len(t) - len(s) + sum(s[i] != t[i] for i in range(len(s))) def aupton(terms): alst = [10] for n in range(2, terms+1): an = alst[-1] + 1 while any(ham(an, aprev) < 2 for aprev in alst[::-1]): an += 1 alst.append(an) return alst print(aupton(60)) # Michael S. Branicky, Jul 22 2021
Extensions
Edited and corrected by N. J. A. Sloane, Jul 20 2021