login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A120241 a(n) = (n - 2^floor(log(n)/log(2)) + 1)-th integer among those positive integers not among the earlier terms of the sequence. 2
1, 2, 4, 3, 6, 8, 10, 5, 9, 12, 14, 16, 18, 20, 22, 7, 13, 17, 21, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 11, 19, 25, 29, 33, 37, 41, 45, 48, 50, 52, 54, 56, 58, 60, 62, 64, 66, 68, 70, 72, 74, 76, 78, 80, 82, 84, 86, 88, 90, 92, 94, 15, 27, 35, 43, 49, 53, 57, 61, 65 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,2
COMMENTS
This sequence is a permutation of the positive integers. n - 2^floor(log(n)/log(2)) + 1 = A062050(n).
LINKS
EXAMPLE
The first 6 terms of the sequence are 1,2,4,3,6,8. Now 7 - 2^floor(log(7)/log(2)) + 1 = 4. So we want the 4th term of those positive integers not occurring among the first 6 terms of the sequence (i.e., the 4th term among 5,7,9,10,11,...). So a(7) = 10.
MATHEMATICA
Fold[Append[#1, Complement[Range[Max[#1] + #2], #1][[#2]]] &, {1},
Flatten@Table[Range[2^k], {k, 6}]] (* Ivan Neretin, Sep 24 2021 *)
CROSSREFS
Sequence in context: A039864 A101906 A297403 * A352714 A355435 A155487
KEYWORD
easy,nonn
AUTHOR
Leroy Quet, Jun 11 2006
EXTENSIONS
Extended by Ray Chandler, Jun 19 2006
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified July 15 19:27 EDT 2024. Contains 374334 sequences. (Running on oeis4.)