A343444 Smallest nonnegative integer such that altering at most one of its digits cannot result in a previous term.
0, 11, 22, 33, 44, 55, 66, 77, 88, 99, 101, 110, 123, 132, 145, 154, 167, 176, 189, 198, 202, 213, 220, 231, 246, 257, 264, 275, 303, 312, 321, 330, 347, 356, 365, 374, 404, 415, 426, 437, 440, 451, 462, 473, 505, 514, 527, 536, 541, 550, 563, 572, 606, 617, 624, 635, 642, 653, 660, 671, 707, 716, 725, 734, 743, 752
Offset: 1
Links
- 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.
- Wikipedia, Hamming distance
Programs
-
Python
def ham(m, n): s, t = str(min(m, n)), str(max(m, n)) s = '0'*(len(t)-len(s)) + s return sum(s[i] != t[i] for i in range(len(t))) def aupton(terms): alst = [0] for n in range(2, terms+1): an = alst[-1] + 1 while any(ham(an, alst[-i]) < 2 for i in range(1, len(alst)+1)): an += 1 alst.append(an) return alst print(aupton(66)) # Michael S. Branicky, Apr 15 2021
Comments