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 31-35 of 35 results.

A304237 a(n) is the smallest positive integer not yet in the sequence that is obtained when the first and last digits of a(n-1) are exchanged and used in a(n) in the exchanged order (but not necessarily adjacent); a(1)=10.

Original entry on oeis.org

10, 101, 11, 110, 201, 12, 21, 102, 121, 111, 112, 210, 202, 22, 122, 211, 120, 301, 13, 31, 103, 131, 113, 231, 123, 310, 203, 32, 23, 132, 212, 220, 302, 213, 232, 221, 124, 41, 14, 141, 114, 241, 125, 51, 15, 151, 115, 251, 126, 61, 16, 161, 116, 261, 127, 71, 17, 171, 117, 271, 128, 81, 18, 181, 118
Offset: 1

Views

Author

Enrique Navarrete, May 08 2018

Keywords

Comments

Up to n=82, the only consecutive numbers in the sequence are 111, 112 and 222, 223.
Could have started sequence with offset a(0)=0 and it would be the same sequence.

Examples

			a(2)=101 since 101 is the smallest positive number not yet in the sequence that is obtained when the first and last digits of a(1)=10 are exchanged and used in that order.
a(8)=102 since 102 is the smallest positive number not yet in the sequence that is obtained when the first and last digits of a(7)=21 are exchanged and used in that order (but not necessarily adjacent).
		

Crossrefs

Programs

  • PARI
    firstTerms(n)={my(Seq=vector(n),a=[1,0],c,y,k,h=Vecsmall(0,1000*n));print1("10,");Seq[1]=10;h[11]=1;for(i=2,n,for(t=11,oo,if(!h[t+1],c=digits(t);y=1;while((y<#c)&&(!c[y]),y++);forvec(u=[[y,#c],[y,#c]],if(k=([c[u[1]],c[u[2]]]==[a[#a],a[1]]),break),2);if(k,Seq[i]=t;print1(t",");a=c;h[t+1]=1;break))));return(Seq)} \\ R. J. Cano, May 11 2018

A318698 a(n) is the smallest nonnegative integer of the same parity as n, not yet in the sequence, that shares a digit with a(n-1); a(0)=0.

Original entry on oeis.org

0, 101, 10, 1, 12, 11, 14, 13, 16, 15, 18, 17, 70, 7, 72, 21, 2, 23, 20, 25, 22, 27, 24, 29, 26, 61, 6, 63, 30, 3, 32, 31, 34, 33, 36, 35, 38, 37, 74, 41, 4, 43, 40, 45, 42, 47, 44, 49, 46, 65, 50, 5, 52, 51, 54, 53, 56, 55, 58, 57, 76, 67, 60, 69, 62, 121, 28, 81, 8
Offset: 0

Views

Author

Enrique Navarrete, Aug 31 2018

Keywords

Comments

Conjecture: This is a permutation of the nonnegative integers.
The one-digit integers appear in the following order: 0,1,7,2,6,3,4,5,8,9.

Examples

			a(1)=101 since 101 is the smallest odd nonnegative integer not yet in the sequence that shares the digit 0 with a(0)=0;
a(2)=10 since 10 is the smallest even nonnegative integer not yet in the sequence that shares the digit 0 (and 1) with a(1)=101.
		

Crossrefs

Programs

  • Maple
    N:= 1000: # to stop before the first term > N
    S0:= [seq(i,i=2..N,2)]: S1:= [seq(i,i=1..N,2)]:
    D0:= map(t -> convert(convert(t,base,10),set), S0):
    D1:= map(t -> convert(convert(t,base,10),set), S1):
    A[0]:= 0: Da:= {0}: found:= true:
    for n from 1 while found do
      found:= false;
      if n::even then
        for j from 1 to nops(D0) do
          if Da intersect D0[j] <> {} then
            found:= true;
            A[n]:= S0[j];
            Da:= D0[j];
            S0:= subsop(j=NULL, S0);
            D0:= subsop(j=NULL, D0);
            break
          fi
        od
      else
        for j from 1 to nops(D1) do
          if Da intersect D1[j] <> {} then
            found:= true;
            A[n]:= S1[j];
            Da:= D1[j];
            S1:= subsop(j=NULL, S1);
            D1:= subsop(j=NULL, D1);
            break
          fi
        od
      fi
    od:
    seq(A[i],i=0..n-2); # Robert Israel, Feb 05 2020

A323708 a(n) is the smallest positive number not yet in the sequence that contains both the smallest and largest digits from a(n-1); a(1)=1.

Original entry on oeis.org

1, 10, 100, 101, 102, 20, 120, 200, 201, 202, 203, 30, 103, 130, 230, 300, 301, 302, 303, 304, 40, 104, 140, 204, 240, 340, 400, 401, 402, 403, 404, 405, 50, 105, 150, 205, 250, 305, 350, 450, 500, 501, 502, 503, 504, 505, 506, 60, 106, 160, 206, 260, 306, 360
Offset: 1

Views

Author

Enrique Navarrete, Jan 24 2019

Keywords

Comments

All terms starting with a(2)=10 must contain the digit 0.
From a(110)=809 onwards all terms must contain the digits 0 and 9.
Note that A011540 can also be defined as the sequence where a(n) is the smallest number not yet in the sequence that contains the smallest digit from a(n-1). See crossrefs.

Examples

			a(2)=10 since 10 is the smallest positive number not yet in the sequence that contains the smallest and largest digit (i.e., 1) from a(1)=1.
a(6)=20 since 20 is the smallest positive number not yet in the sequence that contains the smallest and largest digits from a(5)=102.
		

Crossrefs

Cf. A107353, A011540 (smallest digit only), A286890 (largest digit only), A303605.

Programs

  • Maple
    N:= 1000: # for terms before the first term > N
    A[1]:= 1:
    S:= [$2..N]:
    dmin:= 1: dmax:= 1:
    found:= true:
    for n from 2 while found do
        found := false;
        for i from 1 to nops(S) do
          L:= convert(convert(S[i],base,10),set);
          if {dmin,dmax} subset L then
             A[n]:= S[i];
             dmax:= max(L);
             dmin:= min(L);
             found:= true;
             S:= subsop(i=NULL, S);
             break
          fi
        od;
    od:
    convert(A,list); # Robert Israel, Mar 28 2019
  • Mathematica
    Nest[Append[#, Block[{k = 2, d}, While[Nand[FreeQ[#[[All, 1]], k], SubsetQ[Set[d, IntegerDigits[k]], #[[-1, -1]] ]], k++]; {k, {Min@ d, Max@ d}}]] &, {{1, {1, 1}}}, 53][[All, 1]] (* Michael De Vlieger, Jan 27 2019 *)
  • PARI
    getFirstTerms(n)={my(Z=List(),A=List([1]),dd=[0,1],c,m=1);for(k=2,+oo,forvec(y=vector(k,u,[u==1,9]),listput(Z,y);for(i=1,#Z,if(m==n,return(Vec(A)));c=2;for(q=1,2,for(j=1,#Z[i],if(Z[i][j]==dd[q],c--;break)));if(!c,dd[1]=vecmin(Z[i]);dd[2]=vecmax(Z[i]);listput(A,fromdigits(Z[i]));listpop(Z,i);m++;break)),0))} \\ R. J. Cano, Feb 04 2019
    
  • PARI
    isok(k, vas, dm, dM) = {if (vecsearch(vas, k), return (0)); my(dk = Set(digits(k))); vecsearch(dk, dm) && vecsearch(dk, dM);}
    nexta(va, vas, i) = {my(k=1, d=digits(va[i]), dm = vecmin(d), dM = vecmax(d)); while (!isok(k, vas, dm, dM), k++); k;}
    lista(nn) = {my(va = vector(nn)); va[1] = 1; my(vas = vecsort(va,,8)); for (n=2, nn, va[n] = nexta(va, vas, n-1); vas = vecsort(va,,8);); va;} \\ Michel Marcus, Feb 05 2019

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

A318699 a(n) is the smallest nonnegative integer of opposite parity to n, not yet in the sequence, that shares a digit with a(n-1); a(0) = 1.

Original entry on oeis.org

1, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 90, 9, 92, 21, 2, 23, 20, 25, 22, 27, 24, 29, 26, 61, 6, 63, 30, 3, 32, 31, 34, 33, 36, 35, 38, 37, 70, 7, 72, 47, 4, 41, 40, 43, 42, 45, 44, 49, 46, 65, 50, 5, 52, 51, 54, 53, 56, 55, 58, 57, 74, 67, 60, 69, 62, 121, 28, 81, 8, 83, 48, 85, 68, 87, 76, 71, 78, 73, 130, 39, 94, 59, 96, 79, 98, 89, 80, 101, 0, 103, 100, 91, 102, 105, 104, 107, 106, 109, 108
Offset: 0

Views

Author

Enrique Navarrete, Aug 31 2018

Keywords

Comments

Conjecture: this is a permutation of the nonnegative integers.
The one-digit integers appear in the following order: 1,9,2,3,7,4,6,5,8,0.

Examples

			a(1) = 10 since 10 is the smallest even integer not yet in the sequence that shares the digit 1 with a(0) = 1; a(2) = 11 since 11 is the smallest odd integer not yet in the sequence that shares the digit 1 with a(1) = 10.
		

Crossrefs

Programs

  • Python
    cur = [1]
    while len(cur) < 100:
        for x in range(100000):
            flag = False
            if x not in cur:#not currently used
                if x % 2 != cur[-1] % 2:#opposite parity
                    j = str(x)
                    k = str(cur[-1])
                    for a in k:
                        if a in j:
                            cur.append(x)
                            flag = True
                            break
            if flag:
                break
    print(cur)
    # David Consiglio, Jr., Oct 04 2018

Extensions

Corrected and extended by David Consiglio, Jr., Oct 04 2018
Previous Showing 31-35 of 35 results.