OFFSET
1,2
LINKS
Ivan Neretin, Table of n, a(n) for n = 1..10000
EXAMPLE
Index of the first occurrence of 2 is 2 and that of the second occurrence is 5, separated by a(3) and a(4), two terms.
MATHEMATICA
mx = 22; lst = cnt = ConstantArray[0, mx + 1]; a = {}; Do[k = Min@Select[Range[mx + 1], lst[[#]] <= n && cnt[[#]] < # &]; AppendTo[a, k]; lst[[k]] = n + k + 1; cnt[[k]]++; If[k > mx, Break[]], {n, mx^2}]; a (* Ivan Neretin, Nov 25 2016 *)
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Amarnath Murthy, Dec 05 2004
EXTENSIONS
Extended by Ray Chandler, Dec 08 2004
STATUS
approved