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.

Showing 1-5 of 5 results.

A346000 Lexicographically earliest sequence of nonnegative integers such that two distinct terms differ by at least 4 decimal digits.

Original entry on oeis.org

0, 1111, 2222, 3333, 4444, 5555, 6666, 7777, 8888, 9999, 10123, 11032, 12301, 13210, 14567, 15476, 16745, 17654, 20231, 21320, 22013, 23102, 24675, 25764, 26457, 27546, 30312, 31203, 32130, 33021, 34756, 35647, 36574, 37465
Offset: 1

Views

Author

N. J. A. Sloane, Jul 20 2021

Keywords

Comments

This is the distance 4 lexicode over the decimal alphabet.

Crossrefs

Lexicodes of minimal distance 1,2,3,... over alphabets of size 2: A001477, A001969, A075926, A075928, A075931, A075934, ...; size 3: A001477, A346002, A346003; size 10: A001477, A343444, A333568, A346000, A346001.

Programs

  • Maple
    # Hamming distance in base b
    Hammdist:=proc(m,n,b) local t1,t2,L1,L2,L,d,i;
    t1:=convert(m,base,b); L1:=nops(t1);
    t2:=convert(n,base,b); L2:=nops(t2); L:=L1;
    if L2t2[i] then d:=d+1; fi; od;
    d; end;
    # Build lexicode with min distance D in base b, search up to M
    # C = size of code found, tooc = 1 means too close to code
    unprotect(D);
    lexicode := proc(D,b,M) local cod,v,i,tooc,C;
    cod:=[0]; C:=1;
    # can we add v ?
    for v from 0 to M do
       tooc:=-1;
       for i from 1 to C do
       if Hammdist(v,cod[i],b)
    				

A346001 Lexicographically earliest sequence of nonnegative integers such that two distinct terms differ by at least 5 decimal digits.

Original entry on oeis.org

0, 11111, 22222, 33333, 44444, 55555, 66666, 77777, 88888, 99999, 101234, 110325, 123016, 132107, 145670, 154761, 167452, 176543, 202318, 213209, 220153, 231042, 246735, 257624, 264580, 275491
Offset: 1

Views

Author

N. J. A. Sloane, Jul 20 2021

Keywords

Comments

This is the distance 5 lexicode over the decimal alphabet.

Crossrefs

Lexicodes of minimal distance 1,2,3,... over alphabets of size 2: A001477, A001969, A075926, A075928, A075931, A075934, ...; size 3: A001477, A346002, A346003; size 10: A001477, A343444, A333568, A346000, A346001.

Programs

A346002 Distance 2 lexicode over the alphabet {0,1,2}, with the codewords written in base 10.

Original entry on oeis.org

0, 4, 8, 10, 12, 20, 24, 28, 30, 36, 40, 44, 50, 52, 56, 60, 68, 70, 72, 76, 80, 82, 84, 90, 94, 98, 104, 106, 108, 112, 116, 118, 120, 128, 132, 140, 142, 146, 150, 154, 156, 164, 168, 176, 178, 180, 184, 188, 194, 196, 200, 204, 208, 210, 216, 220, 224, 226, 228, 236, 240
Offset: 1

Views

Author

N. J. A. Sloane, Jul 20 2021

Keywords

Comments

Lexicographically earliest sequence of ternary words such that any two distinct words differ in at least 2 positions.

Crossrefs

Lexicodes of minimal distance 1,2,3,... over alphabets of size 2: A001477, A001969, A075926, A075928, A075931, A075934, ...; size 3: A001477, A346002, A346003; size 10: A001477, A343444, A333568, A346000, A346001.

Programs

A346003 Distance 3 lexicode over the alphabet {0,1,2}, with the codewords written in base 10.

Original entry on oeis.org

0, 13, 26, 32, 42, 46, 61, 65, 75, 325, 336, 357, 362, 373, 383, 394, 396, 413, 584, 651, 658, 677, 699, 716, 812, 825, 832, 840, 847, 863, 878, 898, 909, 975, 982, 1001, 1023, 1043, 1048, 1148, 1165, 1170, 1194, 1208, 1223, 1254, 1269, 1330, 1341, 1421, 1452
Offset: 1

Views

Author

N. J. A. Sloane, Jul 20 2021

Keywords

Comments

Lexicographically earliest sequence of ternary words such that any two distinct words differ in at least 3 positions.

Crossrefs

Lexicodes of minimal distance 1,2,3,... over alphabets of size 2: A001477, A001969, A075926, A075928, A075931, A075934, ...; size 3: A001477, A346002, A346003; size 10: A001477, A343444, A333568, A346000, A346001.

Programs

  • Maple
    (See A346000).
  • 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

Extensions

Terms a(36) and beyond from Andrey Zabolotskiy, Sep 30 2021

A346261 Lexicographically earliest sequence of decimal words starting with 10 such that each term has Hamming distance at least 2 from all earlier terms.

Original entry on oeis.org

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

Views

Author

Peter Woodward, Jul 11 2021

Keywords

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.
		

Crossrefs

Lexicodes of minimal distance 1,2,3,... over alphabets of size 2: A001477, A001969, A075926, A075928, A075931, A075934, ...; size 3: A001477, A346002, A346003; size 10: A001477, A343444, A333568, A346000, A346001.
Cf. A207063.

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
Showing 1-5 of 5 results.