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-4 of 4 results.

A300907 a(n) is the least positive integer not yet in the sequence in which the largest digit of a(n-2) appears among its digits; a(1)=1, a(2)=2.

Original entry on oeis.org

1, 2, 10, 12, 11, 20, 13, 21, 3, 22, 23, 24, 30, 4, 31, 14, 32, 34, 33, 40, 35, 41, 5, 42, 15, 43, 25, 44, 45, 46, 50, 6, 51, 16, 52, 26, 53, 36, 54, 56, 55, 60, 57, 61, 7, 62, 17, 63, 27, 64, 37, 65, 47, 66, 67, 68, 70, 8, 71, 18, 72, 28, 73, 38, 74, 48, 75, 58, 76, 78, 77, 80
Offset: 1

Views

Author

Enrique Navarrete, Mar 14 2018

Keywords

Comments

Starting from the term a(89)=89, every term must contain a 9.

Examples

			For n=5, a(n-2) = 10 which has largest digit 1.  The positive integers containing 1 are 1, 10, 11, 12, 13, ... (A011531).  Since 1 and 10 are already in the sequence, a(5) = 11. - _Michael B. Porter_, Mar 17 2018
		

Crossrefs

Cf. A286890.

Programs

  • Mathematica
    FromDigits /@ Nest[Function[a, Append[a, Block[{k = 3, d}, While[Nand[FreeQ[a, #], MemberQ[#, Max@ a[[-2]]]] &@ Set[d, IntegerDigits@ k], k++]; d]]], {{1}, {2}}, 70] (* Michael De Vlieger, Mar 16 2018 *)

A303294 a(n) is the least positive integer not yet in the sequence which shares a digit with either a(n-3) or a(n-2) (or with both), but shares no digit with a(n-1); a(1)=0, a(2)=1, a(3)=2.

Original entry on oeis.org

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

Views

Author

Enrique Navarrete, Apr 20 2018

Keywords

Comments

Apparently there exist only 5 pairs of consecutive integers belonging this sequence, a(k+1)-a(k)=1 for k in (1,2,10,18,26). Respectively those pairs are: (0;1), (1;2), (3;4), (5;6), and (7;8).
It seems that a(j)=j only for j in (12,14,31,53,55,60,71,73,75,82,84,95,102). - R. J. Cano, Apr 22 2018

Examples

			a(10)=3 since it shares a digit (3) with a(8)=13, and shares no digit with a(9)=24.
		

Crossrefs

Programs

  • PARI
    See Cano link.

A302388 a(n) is the least positive integer not yet in the sequence in which the largest digit of a(n-3) appears among its digits; a(1)=1, a(2)=2, a(3)=3.

Original entry on oeis.org

1, 2, 3, 10, 12, 13, 11, 20, 23, 14, 21, 30, 4, 22, 31, 24, 25, 32, 34, 5, 33, 40, 15, 35, 41, 45, 50, 42, 51, 52, 43, 53, 54, 44, 55, 56, 46, 57, 6, 16, 7, 26, 36, 17, 60, 61, 27, 62, 63, 37, 64, 65, 47, 66, 67, 70, 68, 71, 72, 8, 73, 74, 18, 75, 76, 28, 77, 78, 38, 79, 48, 58, 9, 80
Offset: 1

Views

Author

Enrique Navarrete, Apr 06 2018

Keywords

Comments

The only fixed points are 1,2,3,99.
Starting from a(87)=89, every term must contain a 9.
First differences are bounded by -64 and 71.

Examples

			a(7)=11 since the largest digit of a(4)=10 is 1, and 11 is the least positive integer at n=7 that contains 1.
		

Crossrefs

Programs

  • Mathematica
    Nest[Append[#, Block[{k = 4, d}, While[Nand[FreeQ[#[[All, 1]], k], MemberQ[Set[d, IntegerDigits[k]], Max[#[[-3, -1]] ] ] ], k++]; {k, d}]] &, Transpose@ {#, IntegerDigits@ #} &@ Range[3], 71][[All, 1]] (* Michael De Vlieger, Apr 12 2018 *)
  • PARI
    firstTerms(m)={my(Seq:list=List([1,2,3]),z,cp,r,ok);cp=vector(10,u,u-1);for(i=4,m,z=vecmax(digits(Seq[i-3]));for(t=1,oo,forvec(y=vector(t,u,[1,#cp]),ok=0;for(j=1,t,if(cp[y[j]]==z,ok=1;break));if(ok,r=fromdigits(vector(t,u,cp[y[u]]));for(w=1,#Seq,if(r==Seq[w],ok=0;break));if(ok,listput(Seq,r);break(2))))));return(Seq)} \\ R. J. Cano, Apr 14 2018

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