This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A182560 #20 May 11 2025 15:26:51 %S A182560 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 A182560 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 A182560 30,47,56,31,32,57,26,35,62,31,32,63,96,97,34,99,102,39,96,103 %N A182560 a(n) = (a(n-1) AND a(n-2)) XOR n. %C A182560 Conjecture: sequence contains infinitely many zeros. %C A182560 a(6*A000695(n)) = 0. [_Reinhard Zumkeller_, May 05 2012] %H A182560 Reinhard Zumkeller, <a href="/A182560/b182560.txt">Table of n, a(n) for n = 0..10000</a> %H A182560 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/AND.html">AND</a> %H A182560 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/XOR.html">XOR</a> %H A182560 Wikipedia, <a href="http://en.wikipedia.org/wiki/Bitwise_operation#AND">Bitwise operation AND</a> %H A182560 Wikipedia, <a href="http://en.wikipedia.org/wiki/Bitwise_operation#XOR">Bitwise operation XOR</a> %F A182560 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. %t A182560 nxt[{n_,a_,b_}]:={n+1,b,BitXor[BitAnd[a,b],n+1]}; NestList[nxt,{1,0,1},80][[All,2]] (* _Harvey P. Dale_, Jan 01 2019 *) %o A182560 (Python) %o A182560 prpr = 0 %o A182560 prev = 1 %o A182560 for n in range(2,55): %o A182560 current = (prev & prpr) ^ n %o A182560 print(prpr, end=' ') %o A182560 prpr = prev %o A182560 prev = current %o A182560 (Haskell) %o A182560 import Data.Bits ((.&.), xor) %o A182560 a182560 n = a182560_list !! n %o A182560 a182560_list = 0 : 1 : 2 : zipWith xor [3..] %o A182560 (tail $ zipWith (.&.) a182560_list $ tail a182560_list) :: [Integer] %o A182560 -- _Reinhard Zumkeller_, May 05 2012 %Y A182560 Cf. A182389, A182538. %K A182560 nonn,base,easy %O A182560 0,3 %A A182560 _Alex Ratushnyak_, May 05 2012