login
The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A099896 A permutation of the natural numbers where a(n) = n XOR [n/2] XOR [n/4]. 5
1, 3, 2, 7, 6, 4, 5, 14, 15, 13, 12, 9, 8, 10, 11, 28, 29, 31, 30, 27, 26, 24, 25, 18, 19, 17, 16, 21, 20, 22, 23, 56, 57, 59, 58, 63, 62, 60, 61, 54, 55, 53, 52, 49, 48, 50, 51, 36, 37, 39, 38, 35, 34, 32, 33, 42, 43, 41, 40, 45, 44, 46, 47, 112, 113, 115, 114, 119, 118, 116 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,2

COMMENTS

Related to Gray code numbers (A003188) since A003188(n) = n XOR [n/2].

Inverse: A100280; A100281(n) = a(a(n)). - Reinhard Zumkeller, Nov 11 2004

LINKS

Ivan Neretin, Table of n, a(n) for n = 1..8191

Index entries for sequences that are permutations of the natural numbers

FORMULA

XOR BINOMIAL transform begins: B={1, 2, 3, 7, 7, 0, 0, 14, 14, 0, 0, ...} and continues with B(2^k)=B(2^k+1)=7*2^(k-2) (for k>=2) and zeros elsewhere.

MATHEMATICA

Array[BitXor[BitXor[#, Floor[#/2]], Floor[#/4]]&, 70] (* Harvey P. Dale, Aug 10 2012 *)

PROG

(PARI) a(n)=bitxor(bitxor(n, n\2), n\4)

CROSSREFS

Cf. A003188, A099884.

Sequence in context: A096899 A265345 A154448 * A160679 A233276 A304083

Adjacent sequences:  A099893 A099894 A099895 * A099897 A099898 A099899

KEYWORD

nonn,look

AUTHOR

Paul D. Hanna, Nov 09 2004

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.

License Agreements, Terms of Use, Privacy Policy. .

Last modified February 21 19:31 EST 2020. Contains 332110 sequences. (Running on oeis4.)