OFFSET
0,2
COMMENTS
Conjecture: This is a permutation of the nonnegative integers.
The one-digit integers appear in the following order: 0,1,7,2,6,3,4,5,8,9.
LINKS
Robert Israel, Table of n, a(n) for n = 0..10000
EXAMPLE
a(1)=101 since 101 is the smallest odd nonnegative integer not yet in the sequence that shares the digit 0 with a(0)=0;
a(2)=10 since 10 is the smallest even nonnegative integer not yet in the sequence that shares the digit 0 (and 1) with a(1)=101.
MAPLE
N:= 1000: # to stop before the first term > N
S0:= [seq(i, i=2..N, 2)]: S1:= [seq(i, i=1..N, 2)]:
D0:= map(t -> convert(convert(t, base, 10), set), S0):
D1:= map(t -> convert(convert(t, base, 10), set), S1):
A[0]:= 0: Da:= {0}: found:= true:
for n from 1 while found do
found:= false;
if n::even then
for j from 1 to nops(D0) do
if Da intersect D0[j] <> {} then
found:= true;
A[n]:= S0[j];
Da:= D0[j];
S0:= subsop(j=NULL, S0);
D0:= subsop(j=NULL, D0);
break
fi
od
else
for j from 1 to nops(D1) do
if Da intersect D1[j] <> {} then
found:= true;
A[n]:= S1[j];
Da:= D1[j];
S1:= subsop(j=NULL, S1);
D1:= subsop(j=NULL, D1);
break
fi
od
fi
od:
seq(A[i], i=0..n-2); # Robert Israel, Feb 05 2020
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Enrique Navarrete, Aug 31 2018
STATUS
approved