OFFSET
1,1
COMMENTS
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
FORMULA
From Robert Israel, Jul 09 2019: (Start)
For n >= 29, it appears that a(n) = n-1 except:
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.
a(i*10^k+1) = i*10^k+i-1 for 2<=i<=8 or i=10.
(End)
MAPLE
Agenda:= [$0..6, $8..100]: A[1]:= 7: S:= {7}:
for i from 2 do
found:= false;
for j from 1 to nops(Agenda) do
r:= Agenda[j];
Sr:= convert(convert(r, base, 10), set);
if Sr intersect S <> {} then
A[i]:= r;
Agenda:= subsop(j=NULL, Agenda);
S:= Sr;
found:= true;
break
fi
od;
if not found then break fi;
od:
seq(A[n], n=1..i-1); # Robert Israel, Jul 08 2019
MATHEMATICA
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 *)
CROSSREFS
KEYWORD
base,nonn
AUTHOR
Eric Angelini & Zak Seidov, May 24 2005
STATUS
approved