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

Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A006068 a(n) is Gray-coded into n.
(Formerly M2253)
15
0, 1, 3, 2, 7, 6, 4, 5, 15, 14, 12, 13, 8, 9, 11, 10, 31, 30, 28, 29, 24, 25, 27, 26, 16, 17, 19, 18, 23, 22, 20, 21, 63, 62, 60, 61, 56, 57, 59, 58, 48, 49, 51, 50, 55, 54, 52, 53, 32, 33, 35, 34, 39, 38, 36, 37, 47, 46, 44, 45, 40, 41, 43, 42, 127, 126, 124, 125, 120, 121 (list; graph; refs; listen; history; internal format)
OFFSET

0,3

COMMENTS

Equivalently, if binary expansion of n has m bits (say), compute derivative of n (A038554), getting sequence n' of length m-1; sort on n'.

Inverse of sequence A003188 considered as a permutation of the nonnegative integers, i.e. A006068(A003188(n)) = n = A003188(A006068(n)). - Howard A. Landman (howard(AT)polyamory.org), Sep 25 2001

REFERENCES

M. Gardner, Mathematical Games, Sci. Amer. Vol. 227 (No. 2, Feb. 1972), p. 107.

M. Gardner, Knotted Doughnuts and Other Mathematical Entertainments. Freeman, NY, 1986, p. 15.

N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

LINKS

T. D. Noe, Table of n, a(n) for n=0..1023

Paul Tarau, Isomorphic Data Encodings and their Generalization to Hylomorphisms on Hereditarily Finite Data Types

Index entries for sequences that are permutations of the natural numbers

FORMULA

a(n) =2*a(ceiling[(n+1)/2])+A010060(n-1). If 3*2^(k-1) < n <= 2^(k+1), a(n)=2^(k+1)-1-a(n-2^k); if 2^(k+1) < n <= 3*2^k, a(n)=a(n-2^k)+2^k.

a(n) = n XOR [n/2] XOR [n/4] XOR [n/8] ... XOR [n/2^m] where m = [log(n)/log(2)] (for n>0) and [x] is integer floor of x. - Paul D. Hanna (pauldhanna(AT)juno.com), Jun 04 2002

a(n) XOR [a(n)/2] = n. [From Paul D. Hanna, Jan 18 2012]

A066194(n) = a(n-1) + 1, n>=1 . - Philippe DELEHAM, Apr 29 2005

Inverse of sequence A003188 . - Philippe DELEHAM, Apr 29 2005

a(n) = if n<2 then n else 2*m + (n mod 2 + m mod 2) mod 2, with m=a(floor(n/2)). [From Reinhard Zumkeller (reinhard.zumkeller(AT)gmail.com), Aug 10 2010]

EXAMPLE

The first few values of n' are -,-,1,0,10,11,01,00,100,101,111,110,010,011,001,000,... (for n=0..15) and to put these in lexicographic order we must take n in the order 0,1,3,2,7,6,4,5,15,14,12,13,8,9,11,10,...

PROG

(PARI) {a(n)=local(B=n); for(k=1, floor(log(n+1)/log(2)), B=bitxor(B, n\2^k)); B} /* Paul D. Hanna, Jan 18 2012 */

CROSSREFS

Cf. A038554, A005811, A003188, A014550, A003100.

Cf. A054429, A180200. [From Reinhard Zumkeller (reinhard.zumkeller(AT)gmail.com), Aug 15 2010]

Sequence in context: A099896 A160679 A153141 * A154436 A201566 A072764

Adjacent sequences:  A006065 A006066 A006067 * A006069 A006070 A006071

KEYWORD

nonn,easy,nice

AUTHOR

N. J. A. Sloane (njas(AT)research.att.com).

EXTENSIONS

Formula and more terms from Henry Bottomley (se16(AT)btinternet.com), Jan 10 2001

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 15 08:20 EST 2012. Contains 205729 sequences.