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.

A304238 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 (and necessarily adjacent); a(1)=10.

This page as a plain text file.
%I A304238 #24 Jun 28 2018 15:00:37
%S A304238 10,101,11,110,201,12,21,112,121,111,113,31,13,131,114,41,14,141,115,
%T A304238 51,15,151,116,61,16,161,117,71,17,171,118,81,18,181,119,91,19,191,
%U A304238 211,120,301,130,401,140,501,150,601,160,701,170,801,180,901,190,1001,311,132,210,102,212,22,122,213,32,23,232
%N A304238 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 (and necessarily adjacent); a(1)=10.
%C A304238 Unlike A304237, there are no consecutive numbers in the sequence up to n=82.
%C A304238 Could have started sequence with offset a(0)=0 and it would be the same sequence.
%e A304238 a(8)=112 since 112 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 adjacent in that order (without the adjacency condition, we would have a(8)=102 as in A304237).
%o A304238 (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++);for(u=y,#c-1,if(k=([c[u],c[u+1]]==[a[#a],a[1]]),break));if(k,Seq[i]=t;print1(t", ");a=c;h[t+1]=1;break))));return(Seq)} \\ _R. J. Cano_, May 11 2018
%Y A304238 Cf. A304237.
%K A304238 nonn,base
%O A304238 1,1
%A A304238 _Enrique Navarrete_, May 08 2018