Logo

Greetings from The On-Line Encyclopedia of Integer Sequences!

Hints

Search: id:A056539
Displaying 1-1 of 1 results found. page 1
     Format: long | short | internal | text      Sort: relevance | references | number      Highlight: on | off
A056539 Self-inverse permutation: reverse the digits in binary expansion of n, and also complement them (0->1, 1->0) if the run count (A005811) is even. +0
7
0, 1, 2, 3, 6, 5, 4, 7, 14, 9, 10, 13, 12, 11, 8, 15, 30, 17, 22, 25, 26, 21, 18, 29, 28, 19, 20, 27, 24, 23, 16, 31, 62, 33, 46, 49, 54, 41, 38, 57, 58, 37, 42, 53, 50, 45, 34, 61, 60, 35, 44, 51, 52, 43, 36, 59, 56, 39, 40, 55, 48, 47, 32, 63, 126, 65, 94, 97, 110, 81, 78 (list; graph; listen)
OFFSET

0,3

LINKS

Index entries for sequences that are permutations of the natural numbers

FORMULA

a(2n) = A036044(2n), a(2n+1) = A030101(2n+1). - Antti Karttunen (karttu(AT)megabaud.fi), Feb 14 2003

EXAMPLE

n: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15

binary expansion: 0, 1, 10, 11, 100, 101, 110, 111,1000,1001,1010,1011,1100,1101,1110,1111

reversed/complemented: 0, 1, 10, 11, 110, 101, 100, 111,1110,1001,1010,1101,1100,1011,1000,1111

MAPLE

[seq(runcounts2binexp(reverse(binexp2runcounts(j))), j=0..511)];

runcounts2binexp := proc(c) local i, e, n; n := 0; for i from 1 to nops(c) do e := c[i]; n := ((2^e)*n) + ((i mod 2)*((2^e)-1)); od; RETURN(n); end;

binexp2runcounts := proc(nn) local n, a, p, c; n := nn; a := []; p := (`mod`(n, 2)); c := 0; while(n > 0) do c := c+1; n := floor(n/2); if((`mod`(n, 2)) <> p) then a := [c, op(a)]; c := 0; p := (`mod`(p+1, 2)); fi; od; RETURN(a); end;

# reverse given in A056538

CROSSREFS

Cf. A054429.

When restricted to A014486 induces another permutation, A057164. A105726 is a "deep" variant.

Sequence in context: A122308 A122307 A106451 this_sequence A105726 A106452 A056895

Adjacent sequences: A056536 A056537 A056538 this_sequence A056540 A056541 A056542

KEYWORD

base,nonn

AUTHOR

Antti Karttunen Jun 20, 2000

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 25 07:41 EDT 2008. Contains 142293 sequences.


AT&T Labs Research