OFFSET
1,2
COMMENTS
Lexicographically earliest sequence of ternary words such that any two distinct words differ in at least 3 positions.
LINKS
Andrey Zabolotskiy, Table of n, a(n) for n = 1..6000
J. H. Conway, Integral lexicographic codes, Discrete Mathematics 83.2-3 (1990): 219-235.
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.
MAPLE
(See A346000).
PROG
(Python)
def t(n):
d = []
while n:
d.append(n%3)
n //= 3
return d
def dif(n1, n2):
return sum(d1 != d2 for d1, d2 in zip(n1 + [0] * (len(n2)-len(n1)), n2))
a = [0]
for n in range(2000):
if all(dif(t(n1), t(n)) >= 3 for n1 in a):
a.append(n)
print(a) # Andrey Zabolotskiy, Sep 30 2021
CROSSREFS
KEYWORD
nonn,base
AUTHOR
N. J. A. Sloane, Jul 20 2021
EXTENSIONS
Terms a(36) and beyond from Andrey Zabolotskiy, Sep 30 2021
STATUS
approved