Logo

Greetings from The On-Line Encyclopedia of Integer Sequences!

Hints

Search: id:A153142
Displaying 1-1 of 1 results found. page 1
     Format: long | short | internal | text      Sort: relevance | references | number      Highlight: on | off
A153142 Permutation of nonnegative integers: A059893-conjugate of A153152. +0
17
0, 1, 3, 2, 6, 7, 5, 4, 12, 13, 14, 15, 10, 11, 9, 8, 24, 25, 26, 27, 28, 29, 30, 31, 20, 21, 22, 23, 18, 19, 17, 16, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 40, 41, 42, 43, 44, 45, 46, 47, 36, 37, 38, 39, 34, 35, 33, 32, 96, 97, 98, 99, 100, 101, 102 (list; graph; listen)
OFFSET

0,3

COMMENT

This sequence can be also obtained by starting complementing n's binary expansion from the second most significant bit, continuing towards lsb-end until the first 0-bit is reached, which is the last bit to be complemented.

LINKS

A. Karttunen, Table of n, a(n) for n = 0..2047

Index entries for sequences that are permutations of the natural numbers

EXAMPLE

29 = 11101 in binary. By complementing bits in (zero-based) positions 3, 2 and 1 we get 10011 in binary, which is 19 in decimal, thus a(29)=19.

PROGRAM

(MIT Scheme:) (define (a153142 n) (if (< n 2) n (let loop ((maskbit (a072376 n)) (z n)) (cond ((zero? maskbit) z) ((zero? (modulo (floor->exact (/ n maskbit)) 2)) (+ z maskbit)) (else (loop (floor->exact (/ maskbit 2)) (- z maskbit)))))))

CROSSREFS

Inverse: A153141. a(n) = A059893(A153152(A059893(n))) = A059894(A153151(A059894(n))). Differs from A003188 for the first time at n=10, where a(10)=14 while A003188(10)=15. Cf. also A072376. Corresponds to A069768 in the group of Catalan bijections.

Sequence in context: A165199 A120231 A083362 this_sequence A154447 A003188 A154435

Adjacent sequences: A153139 A153140 A153141 this_sequence A153143 A153144 A153145

KEYWORD

nonn,base

AUTHOR

Antti Karttunen (His-Firstname.His-Surname(AT)gmail.com), Dec 20 2008

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 December 17 23:40 EST 2009. Contains 171025 sequences.


AT&T Labs Research