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.

A107778 a(1)=7, a(n) = smallest integer not previously used which contains a digit from a(n-1).

This page as a plain text file.
%I A107778 #12 Oct 13 2019 10:09:55
%S A107778 7,17,1,10,0,20,2,12,11,13,3,23,21,14,4,24,22,25,5,15,16,6,26,27,28,8,
%T A107778 18,19,9,29,32,30,31,33,34,35,36,37,38,39,43,40,41,42,44,45,46,47,48,
%U A107778 49,54,50,51,52,53,55,56,57,58,59,65,60,61,62,63,64,66,67,68,69,76,70
%N A107778 a(1)=7, a(n) = smallest integer not previously used which contains a digit from a(n-1).
%C A107778 Cf. A107353 a(1)=0, A107772 a(1)=1, A107773 a(1)=2, A107774 a(1)=3, A107775 a(1)=4, A107776 a(1)=5, A107777 a(1)=6, A107779 a(1)=8, A107780 a(1)=9, A107781 a(1)=10
%H A107778 Robert Israel, <a href="/A107778/b107778.txt">Table of n, a(n) for n = 1..10000</a>
%F A107778 From _Robert Israel_, Jul 09 2019: (Start)
%F A107778 For n >= 29, it appears that a(n) = n-1 except:
%F A107778   a(i*10^k+j) = i*10^k+j-2 if i=1 and 2<=j<=10, or 2<=i<=8 and 2<=j<=i.
%F A107778   a(i*10^k+1) = i*10^k+i-1 for 2<=i<=8 or i=10.
%F A107778 (End)
%p A107778 Agenda:= [$0..6,$8..100]: A[1]:= 7: S:= {7}:
%p A107778 for i from 2 do
%p A107778   found:= false;
%p A107778   for j from 1 to nops(Agenda) do
%p A107778     r:= Agenda[j];
%p A107778     Sr:= convert(convert(r,base,10),set);
%p A107778     if Sr intersect S <> {} then
%p A107778         A[i]:= r;
%p A107778         Agenda:= subsop(j=NULL,Agenda);
%p A107778         S:= Sr;
%p A107778         found:= true;
%p A107778         break
%p A107778      fi
%p A107778    od;
%p A107778    if not found then break fi;
%p A107778 od:
%p A107778 seq(A[n],n=1..i-1); # _Robert Israel_, Jul 08 2019
%t A107778 f[l_] := Block[{c = 0}, While[ MemberQ[l, c] || Intersection @@ IntegerDigits /@{Last[l], c}=={}, c++ ];Return[Append[l, c]]];Nest[f, {7}, 70] (* _Ray Chandler_, Jul 19 2005 *)
%Y A107778 Cf. A107353, A107772, A107773, A107774, A107775, A107776, A107777, A107779, A107780, A107781.
%K A107778 base,nonn
%O A107778 1,1
%A A107778 _Eric Angelini_ & _Zak Seidov_, May 24 2005