cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A343444 Smallest nonnegative integer such that altering at most one of its digits cannot result in a previous term.

This page as a plain text file.
%I A343444 #26 Aug 08 2021 02:02:49
%S A343444 0,11,22,33,44,55,66,77,88,99,101,110,123,132,145,154,167,176,189,198,
%T A343444 202,213,220,231,246,257,264,275,303,312,321,330,347,356,365,374,404,
%U A343444 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
%N A343444 Smallest nonnegative integer such that altering at most one of its digits cannot result in a previous term.
%C A343444 Allowing prepending the integer representation with zeros; this means the Hamming distance between two digit strings representing different terms is at least 2.
%C A343444 Numbers whose bitwise XOR of digits is equal to zero. - _Jeremias M. Gomes_, Jul 25 2021
%H A343444 J. H. Conway and N. J. A. Sloane, <a href="https://doi.org/10.1109/TIT.1986.1057187">Lexicographic codes: error-correcting codes from game theory</a>, IEEE Transactions on Information Theory, 32:337-348, 1986.
%H A343444 Wikipedia, <a href="https://en.wikipedia.org/wiki/Hamming_distance">Hamming distance</a>
%o A343444 (Python)
%o A343444 def ham(m, n):
%o A343444   s, t = str(min(m, n)), str(max(m, n))
%o A343444   s = '0'*(len(t)-len(s)) + s
%o A343444   return sum(s[i] != t[i] for i in range(len(t)))
%o A343444 def aupton(terms):
%o A343444   alst = [0]
%o A343444   for n in range(2, terms+1):
%o A343444     an = alst[-1] + 1
%o A343444     while any(ham(an, alst[-i]) < 2 for i in range(1, len(alst)+1)): an += 1
%o A343444     alst.append(an)
%o A343444   return alst
%o A343444 print(aupton(66)) # _Michael S. Branicky_, Apr 15 2021
%Y A343444 Cf. A001969, A075928, A333568, A346261.
%K A343444 base,easy,nonn
%O A343444 1,2
%A A343444 _Bert Dobbelaere_, Apr 15 2021