Logo

Greetings from The On-Line Encyclopedia of Integer Sequences!

Hints

Search: id:A059894
Displaying 1-1 of 1 results found. page 1
     Format: long | short | internal | text      Sort: relevance | references | number      Highlight: on | off
A059894 Complement and reverse the order of all but the most significant bit in binary expansion of n. n = 1ab..yz -> 1ZY..BA = a(n), where A=1-a, B=1-b,.. +0
10
1, 3, 2, 7, 5, 6, 4, 15, 11, 13, 9, 14, 10, 12, 8, 31, 23, 27, 19, 29, 21, 25, 17, 30, 22, 26, 18, 28, 20, 24, 16, 63, 47, 55, 39, 59, 43, 51, 35, 61, 45, 53, 37, 57, 41, 49, 33, 62, 46, 54, 38, 58, 42, 50, 34, 60, 44, 52, 36, 56, 40, 48, 32, 127, 95, 111, 79, 119, 87, 103, 71 (list; graph; listen)
OFFSET

1,2

COMMENT

A self-inverse permutation. Also a(n)=A054429(A059893(n))=A059893(A054429(n)).

LINKS

Harry J. Smith, Table of n, a(n) for n=1,...,1024

FORMULA

a(1) = 1, a(2n) = a(n) + 2^([log2(n)]+1), a(2n+1) = a(n) + 2^[log2(n)]. - Ralf Stephan (ralf(AT)ark.in-berlin.de), Aug 21 2003

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

EXAMPLE

a(9)=a(1001)=1011=11.

PROGRAM

(PARI) a(n)=local(v, l):v=binary(n):l=length(v):2^(l-1)+sum(k=0, l-2, if(!v[k+2], 2^k))

b(n)=if(n<2, 1, if(n%2==0, b(n/2)+2^(floor(log2(n/2))+1), b((n-1)/2)+2^floor(log2((n-1)/2))))

(PARI) { for (n=1, 1024, a=1; b=n; while (b>1, a=2*a + 1 - 2*frac(b/2); b=floor(b/2); ); write("b059894.txt", n, " ", a); ) } [From Harry J. Smith (hjsmithh(AT)sbcglobal.net), Jun 30 2009]

CROSSREFS

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

Sequence in context: A082317 A163915 A163916 this_sequence A126314 A086702 A156140

Adjacent sequences: A059891 A059892 A059893 this_sequence A059895 A059896 A059897

KEYWORD

base,easy,nonn

AUTHOR

Marc LeBrun (mlb(AT)well.com), Feb 06 2001

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 November 29 12:46 EST 2009. Contains 167659 sequences.


AT&T Labs Research