OFFSET
0,3
COMMENTS
This sequence is also self-descriptive in that each element gives the number of first occurrences of integers (X's in the example) that were removed just before it.
EXAMPLE
If we denote the first occurrence of each integer by X we get:
X, 1, X, 1, X, X, 2, X, 1, X, X, X, 3, X, X, X, X, 4, X, X, 2, ...
and dropping the X's:
1, 1, 2, 1, 3, 4, 2, ...
which is the beginning of the original sequence.
MATHEMATICA
uppertrim[list_]:= Fold[DeleteCases[#1, #2, 1, 1]&, list, Range[Max[list]]]; Nest[Flatten[Append[#, Append[Range[Max[#] + 1, Max[#] + #[[Length[uppertrim[#]] + 1]]], #[[Length[uppertrim[#]] + 1]]]]] &, {1, 1}, 10] (* Birkas Gyorgy, Apr 27 2011 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Kerry Mitchell, Dec 05 2005
STATUS
approved