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.

A303657 a(n) is the least positive integer not yet in the sequence which shares a digit with a(n-2); a(1)=0, a(2)=1.

This page as a plain text file.
%I A303657 #23 May 17 2018 17:53:35
%S A303657 0,1,10,11,12,13,2,3,20,23,21,22,14,24,4,25,34,5,30,15,31,16,17,6,7,
%T A303657 26,27,28,29,8,9,18,19,38,39,32,33,35,36,37,43,47,40,41,42,44,45,46,
%U A303657 48,49,54,59,50,51,52,53,55,56,57,58,65,68,60,61,62,63,64,66
%N A303657 a(n) is the least positive integer not yet in the sequence which shares a digit with a(n-2); a(1)=0, a(2)=1.
%C A303657 Up to n=34 the first differences of the sequence are bounded by -29 and 25; the bounds are -10 and 10 thereafter.
%C A303657 From a(103)=100 onwards, the sequence has slope = 1 with minor jumps about every 100 terms.
%C A303657 It appears that this sequence has an inverse, namely 1, 2, 7, 8, 15, 18, 24, 25, 30, 31, 3, 4, 5, 6, 13, 20, 22, 23, 32, 33, 9, ..., . - _Robert G. Wilson v_, Apr 29 2018 [Edited by _Rémy Sigrist_, May 06 2018]
%H A303657 R. J. Cano, <a href="/A303657/a303657.txt">Sequencer program in PARI.</a>
%e A303657 a(7)=2 since it is the least positive integer not yet in the sequence which shares a digit with a(5)=12.
%t A303657 f[s_List] := Block[{k = 2, l = Union@ IntegerDigits@ s[[-2]]}, While[MemberQ[s, k] || Intersection[l, IntegerDigits@ k] == {}, k++]; Append[s, k]]; Nest[f, {0, 1}, 70] (* _Robert G. Wilson v_, Apr 29 2018 *)
%o A303657 (PARI) Digits(x,b)=if(!x,[0],digits(x,b));
%o A303657 firstTerms(n,{k=2},{b=10})={my(N=b*n);my(s=List(vector(N,u,u-1)),t,x,y);for(m=k+1,n,x=Set(Digits(s[m-k],b));for(i=m,N,y=Set(Digits(s[i],b));if(#setintersect(x,y),t=s[i];listpop(s,i);listinsert(s,t,m);break)));return(Vec(s)[1..n])}
%o A303657 a(n)=firstTerms(n)[n]; \\ _R. J. Cano_, May 05 2018
%o A303657 (PARI) See Cano link.
%Y A303657 Cf. A107353, A303605.
%K A303657 nonn,base
%O A303657 1,3
%A A303657 _Enrique Navarrete_, Apr 27 2018