login
This site is supported by donations to The OEIS Foundation.
Logo

Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A054429 Simple self-inverse permutation of natural numbers: List each block of 2^n numbers (from 2^n to 2^(n+1) - 1) in reverse order. 47
1, 3, 2, 7, 6, 5, 4, 15, 14, 13, 12, 11, 10, 9, 8, 31, 30, 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17, 16, 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, 32, 127, 126, 125, 124, 123, 122, 121 (list; graph; refs; listen; history; internal format)
OFFSET

1,2

COMMENTS

a(n) gives the position of the inverse of the n-th term in the full Stern Brocot tree: A007305(a(n)+2)=A047679(n) and A047679(a(n))=A007305(n+2). [From Reinhard Zumkeller (reinhard.zumkeller(AT)gmail.com), Dec 22 2008]

LINKS

R. Zumkeller, Table of n, a(n) for n = 1..10000

R. Stephan, Some divide-and-conquer sequences ...

R. Stephan, Table of generating functions

Index entries for sequences that are permutations of the natural numbers

FORMULA

a(n) = ReflectBinTreePermutation(n)

a(n) = if n=1 then 1 else 2*a(floor(n/2)) + 1 - n mod 2. - Reinhard Zumkeller (reinhard.zumkeller(AT)gmail.com), Feb 18 2003

1/(1-x) * ((x-2x^2)/(1-x) + sum(k>=0, 3*2^k*x^2^k)). - Ralf Stephan (ralf(AT)ark.in-berlin.de), Sep 15 2003

A000120(a(n)) = A000120(A059894(n)) = A023416(n) + 1. - Ralf Stephan (ralf(AT)ark.in-berlin.de), Oct 05 2003

A115310(n, 1) = a(n). - Reinhard Zumkeller (reinhard.zumkeller(AT)gmail.com), Jan 20 2006

MAPLE

ReflectBinTreePermutation := n -> (((3*(2^floor_log_2(n)))-n)-1); # floor_log_2(x) gives [log2(x)], but floor(log[2](x)) is not healthy in Maple, so use this:

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

See also A054424, A054430.

{A000027, A054429, A059893, A059894} form a 4-group.

Cf. A115303, A115304, A115305, A115306, A115307, A115308, A115309, A106649.

This is Guy Steele's sequence GS(6, 5) (see A135416).

Sequence in context: A130328 A083569 A071574 * A126316 A101224 A139285

Adjacent sequences:  A054426 A054427 A054428 * A054430 A054431 A054432

KEYWORD

nonn,easy

AUTHOR

Antti Karttunen

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Transforms | Puzzles | Hot | Classics
Recent Additions | More pages | Superseeker | Maintained by The OEIS Foundation Inc.

Content is available under The OEIS End-User License Agreement .

Last modified February 17 23:05 EST 2012. Contains 206085 sequences.