OFFSET
1,2
COMMENTS
From Steve Witham (sw(AT)tiac.net), Oct 13 2009: (Start)
Starting the sequence (and its index) at 1 (as in A082008) instead of 0 (as in A082007) seems more natural. This was conceived as a way to arrange a heapsort in memory to improve locality of reference. The classic Williams/Floyd heapsort also works a little more naturally when the origin is 1.
This sequence is a permutation of the integers >= 1. (End)
Moreover, the first 2^2^n - 1 terms are a permutation of the first 2^2^n - 1 positive integers. - Ivan Neretin, Mar 12 2017
LINKS
Ivan Neretin, Table of n, a(n) for n = 1..8191
Steve Witham, Clumpy Heapsort
Steve Witham, Clumpy Heapsort. [From Steve Witham (sw(AT)tiac.net), Oct 13 2009]
FORMULA
MATHEMATICA
w = {{1}}; Do[k = 2^Floor@Log2[n - 1]; AppendTo[w, Flatten@Table[w[[n - k]] + (2^k - 1) i, {i, 2^k}]], {n, 2, 7}]; a = Flatten@w (* Ivan Neretin, Mar 12 2017 *)
PROG
CROSSREFS
KEYWORD
nonn,tabf
AUTHOR
N. J. A. Sloane, Oct 06 2009, based on a posting by Steve Witham (sw(AT)tiac.net) to the Math Fun Mailing List, Sep 30 2009
EXTENSIONS
The origin is 1 Steve Witham (sw(AT)tiac.net), Oct 13 2009
STATUS
approved