OFFSET
1,2
FORMULA
a(1)=1, for n>1, a(n) = A214370(n-1)+1.
MATHEMATICA
mex[a_]:=Module[{q}, q=1; While[MemberQ[a, q] , q++]; q]; a = Table[0, {k, 1, 100]}]; For[n=1, n<=100, n++, {If[a[[n]]==0, a[[n]] = mex[a]]; If[n>1, {nan = n+a[[n]]; If[(nan <= Length[a]) && (a[[nan]] == 0), a[[nan]] = a[[n]]]}]; }]; a
PROG
(Python)
SIZE = 300
a = [-8]*SIZE
top=0
for n in range(SIZE):
if a[n]==-8: # if a[n] is undefined yet
top+=1
a[n]=top
if 1<n+a[n]<SIZE and a[n+a[n]]==-8: # if a[n+a[n]] is undefined yet
a[n+a[n]]=a[n]
print(a[n], end=', ')
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Alex Ratushnyak, Jul 14 2012
STATUS
approved