OFFSET
1,3
COMMENTS
Initial fixed points are 47, 52, 56, 58, 72, 81, 94, 101, 13661, 13663. - Corrected and extended by Robert Israel, Feb 09 2018
Inverse: 0, 1, 4, 9, 10, 15, 16, 21, 22, 27, 5, 3, 28, 7, 12, 17, 14, 19, 24, 32, 2, 30, 6, 11, 8, 13, 18, 23, 20, 25, 31, ..., . - Robert G. Wilson v, Feb 09 2018
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
MAPLE
N:= 1000: # to get all terms before the first term > N
a[1] := 0: a[2] := 1: first := 2:
Next := Array(2 .. N, i -> i+1):
Prev := Array(2 .. N, i -> i-1): Prev[2] := 0:
for n from 0 to N do
digs[n] := convert(convert(n, base, 10), set)
od:
for n from 3 do
D1 := digs[a[n-1]];
D2 := digs[a[n-2]];
t := first;
while digs[t] intersect D2 = {} or digs[t] intersect D1 <> {} do
t := Next[t];
if t > N then break fi
od;
if t > N then break fi;
a[n] := t;
if Prev[t] = 0 then first := Next[t] else Next[Prev[t]] := Next[t] fi; if Next[t] <= N then Prev[Next[t]] := Prev[t] fi
od:
seq(a[i], i=1..n-1); # Robert Israel, Feb 09 2018
MATHEMATICA
f[s_List] := Block[{a = Union@ IntegerDigits@ s[[-2]], b = Union@ IntegerDigits@ s[[-1]], k = 2}, While[id = Union@ IntegerDigits@ k; MemberQ[s, k] || Intersection[a, id] == {} || Intersection[b, id] != {}, k++]; Append[s, k]]; Nest[f, {0, 1}, 66] (* Robert G. Wilson v, Feb 09 2018 *)
CROSSREFS
KEYWORD
AUTHOR
Enrique Navarrete, Jan 15 2018
STATUS
approved