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.

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.

This page as a plain text file.
%I A302388 #10 Apr 19 2018 17:37:54
%S A302388 1,2,3,10,12,13,11,20,23,14,21,30,4,22,31,24,25,32,34,5,33,40,15,35,
%T A302388 41,45,50,42,51,52,43,53,54,44,55,56,46,57,6,16,7,26,36,17,60,61,27,
%U A302388 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
%N 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.
%C A302388 The only fixed points are 1,2,3,99.
%C A302388 Starting from a(87)=89, every term must contain a 9.
%C A302388 First differences are bounded by -64 and 71.
%e A302388 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.
%t A302388 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 *)
%o A302388 (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
%Y A302388 Cf. A286890, A300907.
%K A302388 nonn,base
%O A302388 1,2
%A A302388 _Enrique Navarrete_, Apr 06 2018