OFFSET
1,3
COMMENTS
Sum_{i=1..n} a(n) ~ n*(n+1)/5.
EXAMPLE
a(1) = 1;
a(2) = min{(1-1);(1-0)} = 0;
a(3) = min{(2-0);(2-0)} = 2;
a(4) = min{(3-2);(3-0)} = 1;
a(5) = min{(4-1);(4-1)} = 3;
a(6) = min{(5-3);(5-0)} = 2;
a(7) = min{(6-2);(6-3)} = 3;
a(8) = min{(7-3);(7-5)} = 2;
a(9) = min{(8-2);(8-6)} = 2;
a(10) = min{(9-2);(9-8)} = 1;
and so on.
MATHEMATICA
a = {1}; Do[AppendTo[a, Min[n - 1 - a[[n - 1]], n - 1 - (If[MissingQ@#, 0, #] &@ SelectFirst[Range[n - 2, 1, -1], a[[n - 1]] == a[[#]] &])]], {n, 2, 120}]; a (* Michael De Vlieger, Mar 27 2016, Version 10.2 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Ctibor O. Zizka, Mar 22 2016
STATUS
approved