This site is supported by donations to The OEIS Foundation.

 Hints (Greetings from The On-Line Encyclopedia of Integer Sequences!)
 A122155 Simple involution of natural numbers: List each block of (2^k)-1 numbers (from (2^k)+1 to 2^(k+1) - 1) in reverse order and fix the powers of 2. 3
 0, 1, 2, 3, 4, 7, 6, 5, 8, 15, 14, 13, 12, 11, 10, 9, 16, 31, 30, 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17, 32, 63, 62, 61, 60, 59, 58, 57, 56, 55, 54, 53, 52, 51, 50, 49, 48, 47, 46, 45, 44, 43, 42, 41, 40, 39, 38, 37, 36, 35, 34, 33, 64, 127, 126, 125, 124, 123 (list; graph; refs; listen; history; text; internal format)
 OFFSET 0,3 LINKS FORMULA a(0)=0, if n=2^k, a(n) = n, if n=2^k + i (with i > 0 and i < 2^k), a(n) = 2^(k+1) - i = 2*A053644(n) - A053645(n). PROG (Scheme:) (define (A122155 n) (cond ((< n 1) n) ((pow2? n) n) (else (- (* 2 (A053644 n)) (A053645 n))))) (define (pow2? n) (and (> n 0) (zero? (A004198bi n (- n 1))))) CROSSREFS Cf. A054429, A122198, A122199. Sequence in context: A299327 A231551 A122198 * A106454 A270195 A297441 Adjacent sequences:  A122152 A122153 A122154 * A122156 A122157 A122158 KEYWORD nonn AUTHOR Antti Karttunen, Aug 25 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 | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

Last modified August 22 05:00 EDT 2019. Contains 326172 sequences. (Running on oeis4.)