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.

Previous Showing 11-16 of 16 results.

A309540 a(n) is the smallest positive number not yet in the sequence that contains exactly one even digit and exactly one odd digit from a(n-1), and no digit in a(n) is repeated.

Original entry on oeis.org

10, 102, 12, 21, 120, 103, 30, 130, 104, 14, 41, 124, 123, 23, 32, 132, 125, 25, 52, 152, 126, 16, 61, 106, 105, 50, 150, 107, 70, 170, 108, 18, 81, 128, 127, 27, 72, 172, 129, 29, 92, 192, 142, 134, 34, 43, 143, 140, 109, 90, 190, 160, 136, 36, 63, 163
Offset: 1

Views

Author

Enrique Navarrete, Aug 06 2019

Keywords

Examples

			a(2)=102: a(2) is not 100 (since zero would be repeated), nor 101 (since 1 would be repeated).
		

Crossrefs

Programs

  • Maple
    filter:= proc(n) local L;
      L:= convert(n,base,10);
      nops(L) = nops(convert(L,set)) and convert(L mod 2,set) = {0,1};
    end proc:
    Cands:= select(filter, [$11 .. 1000]): nC:= nops(Cands):
    R:= 10: r:= 10: r0, r1:= selectremove(type, convert(convert(r,base,10),set),even):
    for count from 1 do
      found:= false;
      for i from 1 to nC+1-count do
        x:= Cands[i];
        Lx:= convert(convert(x,base,10),set);
        if nops(Lx intersect r0) = 1 and nops(Lx intersect r1) = 1 then
          found:= true;
          R:= R, x;
          r:= x;
          Cands:= subsop(i=NULL, Cands);
          r0, r1:= selectremove(type, convert(convert(r,base,10),set),even);
          break
        fi
      od;
      if not found then break fi;
    od:
    R; # Robert Israel, Jan 09 2025

Extensions

Edited by Robert Israel, Jan 10 2025

A343927 a(1) = 1, a(2) = 2; for n>2, a(n) is the smallest positive integer not yet in the sequence which shares a digit with a(n-1) but not with a(n-2), and where a(n) contains at least one digit not in a(n-1).

Original entry on oeis.org

1, 2, 20, 10, 13, 23, 24, 14, 15, 25, 26, 16, 17, 27, 28, 18, 19, 29, 32, 30, 40, 41, 12, 52, 35, 31, 21, 42, 34, 36, 56, 45, 43, 37, 57, 50, 60, 46, 47, 70, 80, 38, 39, 49, 48, 58, 51, 61, 62, 72, 71, 81, 68, 63, 53, 54, 64, 67, 73, 83, 82, 92, 59, 65, 76, 74, 84, 85, 75, 79, 69, 86, 78, 97, 90
Offset: 1

Views

Author

Scott R. Shannon, May 17 2021

Keywords

Comments

This is the digit sequence equivalent of the Enots Wolley sequence A336957. Like that sequence to avoid the sequence halting rapidly an additional rule is placed on a(n) - it must have as least one digit not in a(n-1). This implies a(n) cannot be a repdigit as otherwise a(n+1) would not exist. If this rule is removed then the sequence terminates after five terms: 1, 2, 20, 10, 11. The next term then does not exist as it must both contain and not contain the digit 1.
The sequence is probably infinite as any a(n) must contain at least two distinct digits, thus a(n+2) can have at most eight distinct digits. This implies that a(n+3) can always be created using a digit in a(n+2) and a digit not in a(n+2). However the behavior of the sequence as n gets very large is unknown.

Examples

			a(3) = 20 as this is the smallest unused positive integer that contains a digit in a(2) = 2 while not containing any digit in a(1) = 1.
a(4) = 10 as this is the smallest unused positive integer that contains a digit in a(3) = 20 while not containing any digit in a(2) = 2.
a(5) = 13 as this is the smallest unused positive integer that contains a digit in a(3) = 10, contains a digit not in a(3), while not containing any digit in a(3) = 20.
		

Crossrefs

A353888 a(n) is the least positive integer not occurring earlier in the sequence that contains at least one digit not in a(n-1); a(1)=1.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 13, 14, 15, 16, 17, 18, 19, 20, 11, 21, 23, 24, 25, 26, 27, 28, 29, 30, 22, 31, 32, 34, 35, 36, 37, 38, 39, 40, 33, 41, 42, 43, 45, 46, 47, 48, 49, 50, 44, 51, 52, 53, 54, 56, 57, 58, 59, 60, 55, 61, 62, 63, 64, 65, 67, 68
Offset: 1

Views

Author

Sergio Pimentel, May 09 2022

Keywords

Comments

The sequence is finite. 1023456789 should be the last number in the sequence, although many smaller numbers should fail to appear. How many terms are in the complete sequence?
The last term is a(1023445778) = 1023456789, the least missing number is 1000000010. - Rémy Sigrist, Jun 03 2022
At that point, the least missing numbers containing the digits 2..9 are 1020001000, 1023001300, 1023401000, 1023450200, 1023456024, 1023456710, 1023456781, 1023456789, resp. - Michael S. Branicky, Aug 26 2022

Examples

			a(11)=12 since a(10)=10 and 12 is the smallest number not occurring earlier in the sequence that contains a digit (2) that is not in 10.
		

Crossrefs

Programs

  • PARI
    isok(k, prev) = {my(d=digits(k)); for (i=1, #d, if (!vecsearch(prev, d[i]), return(1));); return(0);}
    find(va, n) = {my(k=1, prev=Set(digits(va[n-1]))); while (vecsearch(Set(va), k) || !isok(k, prev), k++); k;}
    lista(nn) = {my(va = vector(nn)); va[1] = 1; for (n=2, nn, va[n] = find(va, n);); va;} \\ Michel Marcus, May 11 2022
    (C++) See Links section.
    
  • Python
    from itertools import count, islice
    def agen():  # generator of terms
        an, aset, mu, mink = 0, set(), [10, 1, 2, 3, 4, 5, 6, 7, 8, 9], 1
        while set(str(an)) != set("0123456789"):
            notin = set("0123456789") - set(str(an))
            an = min(mu[i] for i in range(10) if str(i) in notin)
            yield an; aset.add(an)
            for i in range(10):  # update min unused containing digit i
                while mu[i] in aset or str(i) not in str(mu[i]): mu[i] += 1
            for k in range(mink, min(mu)): aset.discard(k)
            mink = min(mu)
    print(list(islice(agen(), 67))) # Michael S. Branicky, Aug 26 2022

A368559 a(1) = 1, a(2) = 2; for n > 2, a(n) is the smallest positive number not occurring earlier such that a(n) contains all the distinct digits of a(n-1) - a(n-2).

Original entry on oeis.org

1, 2, 10, 8, 12, 4, 18, 14, 24, 100, 67, 3, 46, 34, 21, 13, 28, 15, 31, 16, 51, 35, 61, 26, 53, 27, 62, 135, 37, 89, 25, 64, 39, 52, 103, 105, 20, 58, 38, 102, 146, 40, 106, 6, 101, 59, 42, 17, 125, 108, 71, 73, 22, 115, 93, 23, 70, 47, 32, 145, 113, 123, 104, 19, 85, 36, 49, 130, 81, 94
Offset: 1

Views

Author

Scott R. Shannon, Dec 30 2023

Keywords

Comments

The sequence is conjectured to be a permutation of the positive integers. The fixed points begin 1, 2, 95, 122, 156, 318, 1644, 1964, 2189, 2740, 8264, 16904, ... although it is likely there are infinitely more.

Examples

			a(3) = 10 as a(2) - a(1) = 2 - 1 = 1, and 10 is the smallest unused number to contain 1.
a(11) = 67 as a(10) - a(9) = 100 - 24 = 76, and 67 is the smallest unused number to contain 7 and 6.
		

Crossrefs

A383789 a(1) = 1; for n > 1, a(n) is the smallest positive integer not already in the sequence such that it shares at least one digit with a(n-1), and it has a different number of digits from a(n-1).

Original entry on oeis.org

1, 10, 100, 11, 101, 12, 2, 20, 102, 13, 3, 23, 103, 14, 4, 24, 104, 15, 5, 25, 105, 16, 6, 26, 106, 17, 7, 27, 107, 18, 8, 28, 108, 19, 9, 29, 109, 21, 110, 30, 113, 31, 111, 41, 112, 22, 120, 32, 121, 42, 114, 34, 123, 33, 130, 35, 115, 45, 124, 40, 134, 36, 116, 46, 126, 51, 117, 37, 127, 47, 137
Offset: 1

Views

Author

Ali Sada, May 09 2025

Keywords

Examples

			a(6) = 12, and 2 is the smallest number not already in the sequence that shares a digit with 12 and has a different number of digits. So, a(7) = 2.
		

Crossrefs

Programs

  • Magma
    function MySequence(N) a := [1]; while #a lt N do prev := a[#a]; d := Intseq(prev); m := #d; k := 2; repeat is_used := k in a; inter := &and[not x in d : x in Intseq(k)]; len_eq := #Intseq(k) eq m; k +:= 1; until not is_used and not inter and not len_eq; Append(~a, k - 1); end while; return a; end function; MySequence(100); // Vincenzo Librandi, May 17 2025
  • Mathematica
    a[1] = 1; a[n_] := a[n] = Module[{k = 2, s = Array[a, n-1], d = IntegerDigits[a[n-1]], m = IntegerLength[a[n-1]]}, While[! FreeQ[s, k] || Intersection[IntegerDigits[k], d] == {} || IntegerLength[k] == m, k++]; k]; Array[a, 100] (* Amiram Eldar, May 10 2025 *)
  • PARI
    isok(k, nbd, s, va) = if (#select(x->(x==k), va), return(0)); my(d=digits(k)); if (#setintersect(Set(d), s) && (#d != nbd), return(1));
    find(va, n) = my(k=2, d=digits(va[n-1]), nbd=#d, s=Set(d)); while (!isok(k, nbd, s, va), k++); k;
    lista(nn) = my(va = vector(nn)); va[1] = 1; for (n=2, nn, va[n] = find(va, n);); va; \\ Michel Marcus, May 13 2025
    

A365197 a(n) and a(n+1) have k distinct digits in common. The successive ks are the successive digits of the sequence itself.

Original entry on oeis.org

1, 10, 12, 3, 13, 103, 130, 124, 142, 2, 104, 140, 123, 132, 4, 14, 1024, 1042, 1356, 1365, 15, 51, 5, 1023, 1032, 1456, 1465, 7, 17, 107, 170, 125, 152, 1026, 1062, 1345, 1354, 16, 20, 1025, 1052, 18, 2034, 2043, 23, 102, 10234, 102345, 102354, 167, 102367, 102376
Offset: 1

Views

Author

Eric Angelini, Aug 25 2023

Keywords

Comments

All terms are distinct and composed by distinct digits. This is the lexicographically earliest sequence with this property. The sequence is finite but its last term is not known by the author. Note that the sequence would stop much earlier (with a(6) = 31) without an extra rule: a(n) has equal or more digits than the n-th digit of the sequence. Extra rule by Giorgos Kalogeropoulos.

Examples

			a(1) = 1 and a(2) = 10 share exactly 1 digit;
a(2) = 10 and a(3) = 12 share exactly 1 digit;
a(3) = 12 and a(4) =  3 share 0 digit;
a(4) = 3 and a(5) = 13 share exactly 1 digit;
a(5) = 13 and a(6) = 103 share exactly 2 digits, etc.
We see that the successive numbers of shared digits are the successive digits of the sequence itself (the successive shared digits 1, 1, 0, 1, 2 are the successive digits of the integers that start the sequence: 1, 10, 12).
		

Crossrefs

Cf. A184992.

Programs

  • Mathematica
    a[1]=1;a[n_]:=a[n]=(c=1;While[!DuplicateFreeQ[in=(i=IntegerDigits)@c]|| MemberQ[ar=Array[a,n-1],c]||Length@Intersection[i@a[n-1],in]!=Flatten[i/@ar][[n-1]]||IntegerLength@cGiorgos Kalogeropoulos, Aug 25 2023 *)
Previous Showing 11-16 of 16 results.