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.

A350445 a(n) is the smallest number larger than a(n-1) that has only one digit in common with a(n-1).

Original entry on oeis.org

1, 10, 12, 13, 14, 15, 16, 17, 18, 19, 21, 23, 24, 25, 26, 27, 28, 29, 32, 34, 35, 36, 37, 38, 39, 43, 45, 46, 47, 48, 49, 54, 56, 57, 58, 59, 65, 67, 68, 69, 76, 78, 79, 87, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 108, 122, 130, 142, 150, 162, 170, 182, 190, 202, 301, 322, 340, 351, 360, 371, 380, 391, 401, 422, 430
Offset: 1

Views

Author

Rodolfo Kurchan, Dec 31 2021

Keywords

Comments

Terms computed by Claudio Meller.

Examples

			a(11) = 21 because it is the smallest number larger than a(10) = 19 that has exactly one digit in common.
Similarly, a(55) = 108 because it is the smallest number larger than a(54) = 98 that has exactly one digit in common.
		

Crossrefs

Cf. A350444.

Programs

A350671 a(n) is the smallest number not yet in the sequence that has two digits in common with a(n-1), starting with a(1) = 1.

Original entry on oeis.org

1, 11, 10, 102, 12, 21, 22, 2, 122, 20, 100, 30, 33, 3, 133, 23, 32, 123, 13, 31, 101, 14, 41, 44, 4, 144, 24, 42, 124, 104, 40, 140, 103, 105, 15, 51, 55, 5, 155, 25, 52, 125, 110, 16, 61, 66, 6, 166, 26, 62, 126, 106, 60, 160, 107, 17, 71, 77, 7, 177, 27, 72, 127, 113, 18
Offset: 1

Views

Author

Rodolfo Kurchan, Jan 10 2022

Keywords

Comments

Comment from Michael S. Branicky and N. J. A. Sloane, Jan 31 2022: (Start)
The crux is the definition of "x has two digits in common with y". Take each digit d of x in turn, reading from left to right, and see how many times d appears in y. The sum of all these counts must be 2. E.g., x = 122 has two digits in common with 2 because the first 1 has zero matches, the first 2 has one match, and the second 2 has one match. Again, x = 110 has three digits in common with 103 because the first 1 has one match, the second 1 has one match, and the zero has one match.
In general, if x has decimal expansion x_1...x_e, and y has decimal expansion y_1...y_f, and delta(u,v) = 1 if u=v, 0 otherwise, then the number of digits in common between x and y is Sum_{i=1..e} Sum_{j=1..f} delta(x_i, y_j). (End)
Terms computed by Claudio Meller.

Examples

			a(2) = 11 because it is the smallest number that has exactly two digits in common with a(1) = 1; similarly, a(3) = 10 because it has two digits in common with a(2) = 11 and a(4) = 102 because it is the smallest number that is not already in the sequence that has exactly two digits in common with a(3) = 10.
		

Crossrefs

Programs

  • Mathematica
    a[1]=1;a[n_]:=a[n]=(k=1;While[MemberQ[Array[a,n-1],k]||Total[Count[IntegerDigits@a[n-1],#]&/@IntegerDigits@k]!=2,k++];k);Array[a,65] (* Giorgos Kalogeropoulos, Jan 12 2022 *)
  • Python
    from itertools import islice
    def c(s, t): return sum(t.count(si) for si in s)
    def agen(): # generator of terms
        an, target, seen, mink = 1, "1", {1}, 2
        while True:
            yield an
            k = mink
            while k in seen or c(str(k), target) != 2: k += 1
            an, target = k, str(k)
            seen.add(an)
            while mink in seen: mink += 1
    print(list(islice(agen(), 81))) # Michael S. Branicky, Jan 10 2022

A350672 a(n) is the smallest number larger than a(n-1) that has only two digits in common with a(n-1).

Original entry on oeis.org

1, 11, 12, 21, 22, 23, 32, 33, 34, 43, 44, 45, 54, 55, 56, 65, 66, 67, 76, 77, 78, 87, 88, 89, 98, 99, 109, 112, 130, 132, 134, 135, 136, 137, 138, 139, 141, 150, 152, 153, 154, 156, 157, 158, 159, 161, 170, 172, 173, 174, 175, 176, 178, 179, 181, 190, 192, 193, 194, 195
Offset: 1

Views

Author

Rodolfo Kurchan, Jan 10 2022

Keywords

Comments

Terms computed by Claudio Meller.
See A350671 for the definition of number of digits in common between x and y. In particular, if x has r digits in common with y, then y also has r digits in common with x. - Jianing Song, May 07 2022

Examples

			a(11) = 44 because it is the smallest number larger than a(10) = 43 that has exactly two digits in common.
Similarly, a(27) = 109 because it is the smallest number larger than a(26) = 99 that has exactly two digits in common (the digit 9 of 109 it is in common with the first and second 9 of 99).
		

Crossrefs

Programs

  • Mathematica
    a[1]=1;a[n_]:=a[n]=(k=a[n-1]+1;While[Total[Count[IntegerDigits@a[n-1],#]&/@IntegerDigits@k]!=2,k++];k);Array[a,60] (* Giorgos Kalogeropoulos, Jan 12 2022 *)
  • Python
    from itertools import islice
    def c(s, t): return sum(t.count(si) for si in s)
    def agen(): # generator of terms
        an, target = 1, "1"
        while True:
            yield an
            k = an + 1
            while c(str(k), target) != 2: k += 1
            an, target = k, str(k)
    print(list(islice(agen(), 76))) # Michael S. Branicky, Jan 10 2022

A351059 a(n) is the smallest number not yet in the sequence that has three digits in common with a(n-1), starting with a(1) = 1.

Original entry on oeis.org

1, 111, 10, 100, 102, 101, 103, 110, 104, 114, 14, 141, 41, 144, 124, 112, 12, 121, 21, 122, 120, 200, 20, 202, 201, 210, 211, 123, 113, 13, 131, 31, 133, 130, 300, 30, 303, 203, 220, 204, 222, 2, 1222, 23, 223, 32, 232, 132, 212, 125, 115, 15, 151, 51, 155, 105
Offset: 1

Views

Author

Rodolfo Kurchan, Jan 30 2022

Keywords

Comments

See A350671 for the definition of "x has N digits in common with y".
Terms computed by Claudio Meller.

Examples

			a(2) = 111 because it is the smallest number that has exactly three digits in common with a(1) = 1; similarly, a(3) = 10 because it is the smallest number that is not already in the sequence that has exactly three digits in common with a(2) = 111 and a(4) = 100 because it has three digits in common with a(3)= 10.
		

Crossrefs

Programs

  • PARI
    isok(k, d, va) = {if (#select(x->(x==k), va), return(0)); my(dk=digits(k)); sum(i=1, #dk, #select(x->(x==dk[i]), d)) == 3;}
    lista(nn) = {my(va = vector(nn)); va[1] = 1; for (n=2, nn, my(k=1, d = digits(va[n-1])); while(!isok(k,d,va), k++); va[n] = k;); va;} \\ Michel Marcus, Jan 31 2022
  • Python
    from itertools import islice
    def c(s, t): return sum(t.count(si) for si in s)
    def agen(): # generator of terms
        an, target, seen, mink = 1, "1", {1}, 2
        while True:
            yield an
            k = mink
            while k in seen or c(str(k), target) != 3: k += 1
            an, target = k, str(k)
            seen.add(an)
            while mink in seen: mink += 1
    print(list(islice(agen(), 56))) # Michael S. Branicky, Jan 30 2022
    

A351060 a(n) is the smallest number k > a(n-1) such that there are exactly 3 ordered pairs (i,j) where the i-th digit of k and the j-th digit of a(n-1) are equal.

Original entry on oeis.org

1, 111, 120, 121, 123, 131, 132, 133, 134, 141, 142, 144, 145, 151, 152, 155, 156, 161, 162, 166, 167, 171, 172, 177, 178, 181, 182, 188, 189, 191, 192, 199, 219, 221, 231, 232, 234, 242, 243, 244, 245, 252, 253, 255, 256, 262, 263, 266, 267, 272, 273, 277
Offset: 1

Views

Author

Rodolfo Kurchan, Jan 30 2022

Keywords

Comments

Terms computed by Claudio Meller.

Examples

			a(10) = 141 because it is the smallest number greater than a(9) = 134 that has exactly three digits in common.
Similarly, a(33) = 219 because it is the smallest number greater than a(32) = 199 that has exactly three digits in common (the digit 9 of 219 is in common with the first and second 9 of 199).
		

Crossrefs

Programs

  • Maple
    f:= proc(n) local m,Ln,Lm,d,i,j;
      Ln:= convert(n,base,10);
      for m from n+1 do
        Lm:= convert(m,base,10);
        if nops(select(t -> Ln[t[1]]=Lm[t[2]], [seq(seq([i,j],i=1..nops(Ln)),j=1..nops(Lm))]))=3 then
          return m
        fi
       od
    end proc:
    R:= 1: r:= 1:
    for i from 2 to 1000 do
      ro:= r;
      r:= f(r);
      R:= R,r;
    od:
    R; # Robert Israel, May 09 2025
  • PARI
    isok(k, d, va) = {if (#select(x->(x==k), va), return(0)); my(dk=digits(k)); sum(i=1, #dk, #select(x->(x==dk[i]), d)) == 3;}
    lista(nn) = {my(va = vector(nn)); va[1] = 1; for (n=2, nn, my(k=va[n-1], d = digits(va[n-1])); while(!isok(k,d,va), k++); va[n] = k;); va;} \\ Michel Marcus, Jan 31 2022
  • Python
    from itertools import islice
    def c(s, t): return sum(t.count(si) for si in s)
    def agen(): # generator of terms
        an, target = 1, "1"
        while True:
            yield an
            k = an + 1
            while c(str(k), target) != 3: k += 1
            an, target = k, str(k)
    print(list(islice(agen(), 52))) # Michael S. Branicky, Jan 30 2022
    

Extensions

Definition clarified by Robert Israel, May 09 2025
Showing 1-5 of 5 results.