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

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A182560 a(n) = (a(n-1) AND a(n-2)) XOR n. 3

%I

%S 0,1,2,3,6,7,0,7,8,9,2,11,14,7,8,15,24,25,10,27,30,15,24,31,0,25,26,3,

%T 30,31,0,31,32,33,2,35,38,7,32,39,8,41,34,11,46,39,8,47,56,25,42,59,

%U 30,47,56,31,32,57,26,35,62,31,32,63,96,97,34,99,102,39,96,103

%N a(n) = (a(n-1) AND a(n-2)) XOR n.

%C Conjecture: sequence contains infinitely many zeros.

%C a(6*A000695(n)) = 0. [_Reinhard Zumkeller_, May 05 2012]

%H Reinhard Zumkeller, <a href="/A182560/b182560.txt">Table of n, a(n) for n = 0..10000</a>

%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/AND.html">AND</a>

%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/XOR.html">XOR</a>

%H Wikipedia, <a href="http://en.wikipedia.org/wiki/Bitwise_operation#AND">Bitwise operation AND</a>

%H Wikipedia, <a href="http://en.wikipedia.org/wiki/Bitwise_operation#XOR">Bitwise operation XOR</a>

%F a(0)=0, a(1)=1, a(n) = (a(n-1) AND a(n-2)) XOR n, where AND is the bitwise AND operator, XOR is the bitwise exclusive-or operator.

%o (Python)

%o prpr = 0

%o prev = 1

%o for n in range(2,55):

%o . current = (prev & prpr) ^ n

%o . print prpr,

%o . prpr = prev

%o . prev = current

%o (Haskell)

%o import Data.Bits ((.&.), xor)

%o a182560 n = a182560_list !! n

%o a182560_list = 0 : 1 : 2 : zipWith xor [3..]

%o (tail $ zipWith (.&.) a182560_list $ tail a182560_list) :: [Integer]

%o -- _Reinhard Zumkeller_, May 05 2012

%Y Cf. A182389, A182538.

%K nonn,base,easy

%O 0,3

%A _Alex Ratushnyak_, May 05 2012

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent | More pages
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy .

Last modified February 25 12:46 EST 2018. Contains 299654 sequences. (Running on oeis4.)