This site is supported by donations to The OEIS Foundation.

 Hints (Greetings from The On-Line Encyclopedia of Integer Sequences!)
 A182182 a(0) = 0, a(1) = 1; for n > 1, a(n) = a(n-1) XOR a(n-2) XOR n. 1
 0, 1, 3, 1, 6, 2, 2, 7, 13, 3, 4, 12, 4, 5, 15, 5, 26, 14, 6, 27, 9, 7, 24, 8, 8, 25, 11, 9, 30, 10, 10, 31, 53, 11, 28, 52, 12, 29, 55, 13, 18, 54, 14, 19, 49, 15, 16, 48, 16, 17, 51, 17, 22, 50, 18, 23, 61, 19, 20, 60, 20, 21, 63, 21, 106, 62, 22, 107, 57 (list; graph; refs; listen; history; text; internal format)
 OFFSET 0,3 COMMENTS Note that a(3n) = n. LINKS T. D. Noe, Table of n, a(n) for n = 0..1023 Eric Weisstein's World of Mathematics, XOR Wikipedia, Bitwise operation XOR MATHEMATICA t = {0, 1}; Do[AppendTo[t, BitXor[n, t[[-1]], t[[-2]]]], {n, 2, 100}]; t (* T. D. Noe, Apr 18 2012 *) PROG (Python) prpr = 0 prev = 1 for i in range(2, 101): . current = prev ^ prpr ^ i . print current, . prpr = prev . prev = current (Haskell) import Data.Bits (xor) a182182 n = a182182_list !! n a182182_list = 0 : 1 : zipWith xor [2..]                (zipWith xor a182182_list \$ tail a182182_list) :: [Integer] Reinhard Zumkeller, Apr 23 2012 CROSSREFS Cf. A038712. Sequence in context: A181187 A104573 A010467 * A158823 A184168 A122913 Adjacent sequences:  A182179 A182180 A182181 * A182183 A182184 A182185 KEYWORD nonn,base AUTHOR Alex Ratushnyak, Apr 17 2012 STATUS approved

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 .