OFFSET
1,2
MATHEMATICA
Block[{s = Rest@ Nest[Append[#, If[And[#3 > 0, FreeQ[#1, #3]], #3, #1[[-1]] + #2]] & @@ {#, Length@ #, #[[-1]] - Length@ #} &, {0}, 10^5], t, u}, t = MapIndexed[First[#2]/#1 &, s]; u = MapAt[1 &, #, 1] &@ Union@ FoldList[Max, Rest@ t]; Map[s[[ FirstPosition[t, #][[1]] ]] &, u]] (* Michael De Vlieger, Jan 01 2020 *)
CROSSREFS
KEYWORD
nonn,more
AUTHOR
Jud McCranie, Dec 31 2019
STATUS
approved