Logo

Greetings from The On-Line Encyclopedia of Integer Sequences!

Hints

Search: id:A080261
Displaying 1-1 of 1 results found. page 1
     Format: long | short | internal | text      Sort: relevance | references | number      Highlight: on | off
A080261 Simple involution of natural numbers: complement [binary_width(n)/2] least significant bits in the binary expansion of n. +0
2
0, 1, 3, 2, 5, 4, 7, 6, 11, 10, 9, 8, 15, 14, 13, 12, 19, 18, 17, 16, 23, 22, 21, 20, 27, 26, 25, 24, 31, 30, 29, 28, 39, 38, 37, 36, 35, 34, 33, 32, 47, 46, 45, 44, 43, 42, 41, 40, 55, 54, 53, 52, 51, 50, 49, 48, 63, 62, 61, 60, 59, 58, 57, 56, 71, 70, 69, 68, 67, 66, 65, 64, 79 (list; graph; listen)
OFFSET

0,3

LINKS

Index entries for sequences that are permutations of the natural numbers

N. J. A. Sloane, Maple implementation of bitwise AND (ANDnos)

EXAMPLE

Binary expansion of 9 is 1001, we complement 4/2 = two rightmost bits, yielding 1010 = 10, thus a(9)=10. Binary expansion of 20 is 10100, we complement [5/2] = 2 rightmost bits, giving 10111 = 23, thus a(20)=23.

MAPLE

A080261 := proc(n) local w; w := floor(binwidth(n)/2); RETURN(((2^w)*floor(n/(2^w)))+(((2^w)-1)-ANDnos(n, (2^w)-1))); end;

binwidth := n -> (`if`((0 = n), 1, floor_log_2(n)+1));

floor_log_2 := proc(n) local nn, i; nn := n; for i from -1 to n do if(0 = nn) then RETURN(i); fi; nn := floor(nn/2); od; end;

CROSSREFS

Used to construct A080117.

Sequence in context: A093715 A085229 A093714 this_sequence A138310 A137707 A095720

Adjacent sequences: A080258 A080259 A080260 this_sequence A080262 A080263 A080264

KEYWORD

nonn

AUTHOR

Antti Karttunen (my_firstname.my_surname(AT)iki.fi) Feb 11 2003

page 1

Search completed in 0.002 seconds

Lookup | Welcome | Find friends | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Transforms | Puzzles | Hot | Classics
More pages | Superseeker | Maintained by N. J. A. Sloane (njas@research.att.com)

Last modified July 26 23:19 EDT 2008. Contains 142293 sequences.


AT&T Labs Research