OFFSET
1,2
COMMENTS
Sequence is a permutation of the positive integers. 2^ceiling(log_2(n)) + 1 - n is sequence A080079 with a change of offset.
LINKS
Ivan Neretin, Table of n, a(n) for n = 1..8192
EXAMPLE
Since 2^ceiling(log_2(n)) +1 -n = 3 at n = 6, a(6) = the a(3)th (the 4th) smallest positive integer not among the first 5 terms of the sequence. The positive integers not among the first 5 terms are 5,6,8,9,10,... The 4th of these is 9, which is a(6).
MATHEMATICA
a[1] = 1; a[n_] := a[n] = Complement[ Range[100], Table[ a[i], {i, n - 1}]] [[ a[2^Ceiling[ Log[2, n]] + 1 - n]]]; Table[ a[n], {n, 71}] (* Robert G. Wilson v, Jan 13 2005 *)
CROSSREFS
KEYWORD
AUTHOR
Leroy Quet, Dec 18 2004
EXTENSIONS
More terms from Robert G. Wilson v, Jan 13 2005
STATUS
approved