Golomb's sequence to 1000000
CJam (22 bytes)

1{_~$(~$-)~$)}A6#(/]S*


Online demo for only 15 terms

This relies on one of the formulae given in the entry for OEIS A001462, and the use of ~$ to index the stack from the bottom.