OFFSET
1,3
COMMENTS
Up to n=34 the first differences of the sequence are bounded by -29 and 25; the bounds are -10 and 10 thereafter.
From a(103)=100 onwards, the sequence has slope = 1 with minor jumps about every 100 terms.
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]
LINKS
EXAMPLE
a(7)=2 since it is the least positive integer not yet in the sequence which shares a digit with a(5)=12.
MATHEMATICA
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 *)
PROG
(PARI) Digits(x, b)=if(!x, [0], digits(x, b));
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])}
a(n)=firstTerms(n)[n]; \\ R. J. Cano, May 05 2018
(PARI) See Cano link.
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Enrique Navarrete, Apr 27 2018
STATUS
approved