OFFSET
0,2
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..20000
EXAMPLE
Start . . . . . . . . . . . . . . . . . : 1,1,1,1,1,...
Step 0: a(0+a(0)) = a(1)<- a(0)+a(1) = 2 : 1,2,1,1,1,...
Step 1: a(1+a(1)) = a(3)<- a(1)+a(2)+a(3) = 4 : 1,2,1,4,1,...
Step 2: a(2+a(2)) = a(3)<- a(2)+a(3) = 5 : 1,2,1,5,1,...
MAPLE
mx:= 20000: # maximal index needed
b:= proc() 1 end:
a:= proc(n) option remember; global mx; local t;
if n<0 then 0 else a(n-1); t:= b(n);
if n+t<= mx then b(n+t):= add(b(k), k=n..n+t) fi; t
fi
end:
seq(a(n), n=0..100); # Alois P. Heinz, Mar 04 2015
MATHEMATICA
mx = 20000; (* Maximal index needed *)
b[_] = 1;
a[n_] := a[n] = Module[{t}, If[n<0, 0, t = b[n]; If[n+t <= mx, b[n+t] = Sum[b[k], {k, n, n+t}]]; t]];
a /@ Range[0, 100] (* Jean-François Alcover, Nov 13 2020, after Alois P. Heinz *)
CROSSREFS
KEYWORD
nonn,look
AUTHOR
Floor van Lamoen, Mar 02 2015
STATUS
approved