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 A229763 #34 Jan 25 2025 12:49:19 %S A229763 0,1,2,1,4,5,2,1,8,9,10,9,4,5,2,1,16,17,18,17,20,21,18,17,8,9,10,9,4, %T A229763 5,2,1,32,33,34,33,36,37,34,33,40,41,42,41,36,37,34,33,16,17,18,17,20, %U A229763 21,18,17,8,9,10,9,4,5,2,1,64,65,66,65,68,69,66,65,72,73,74 %N A229763 a(n) = (2*n) XOR n AND n, where AND and XOR are bitwise logical operators. %C A229763 a(n) is the least significant 1-bit of each run of consecutive 1's in n, and everywhere else 0's. Or equivalently, clear to 0 each 1-bit which has another 1 immediately below. - _Kevin Ryde_, Feb 27 2021 %H A229763 Reinhard Zumkeller, <a href="/A229763/b229763.txt">Table of n, a(n) for n = 0..8191</a> %H A229763 Hsien-Kuei Hwang, Svante Janson, and Tsung-Hsi Tsai, <a href="https://arxiv.org/abs/2210.10968">Identities and periodic oscillations of divide-and-conquer recurrences splitting at half</a>, arXiv:2210.10968 [cs.DS], 2022, p. 41. %F A229763 a(n) = ((2*n) XOR n) AND n = ((2*n) AND n) XOR n. %F A229763 a(2n) = 2a(n), a(2n+1) = A229762(n). - _Ralf Stephan_, Oct 07 2013 %F A229763 a(n) = n AND NOT 2n. - _Chai Wah Wu_, Jun 29 2022 %F A229763 G.f.: x/(1 - x^2) + Sum_{k>=1}(2^k*x^(2^k)/((1 - x)*(1 + x^(2^k))*(1 + x^(2^(k - 1))))). - _Miles Wilson_, Jan 24 2025 %e A229763 From _Kevin Ryde_, Feb 27 2021: (Start) %e A229763 n = 1831 = binary 11100100111 %e A229763 a(n) = 289 = binary 100100001 low 1-bit each run %e A229763 (End) %t A229763 Array[BitAnd[BitXor[2 #, #], #] &, 75, 0] (* _Michael De Vlieger_, Nov 03 2022 *) %o A229763 (Python) %o A229763 for n in range(333): print (2*n ^ n) & n, %o A229763 (Python) %o A229763 def A229763(n): return n&~(n<<1) # _Chai Wah Wu_, Jun 29 2022 %o A229763 (Haskell) %o A229763 import Data.Bits ((.&.), xor, shiftL) %o A229763 a229763 n = (shiftL n 1 `xor` n) .&. n :: Int %o A229763 -- _Reinhard Zumkeller_, Oct 10 2013 %o A229763 (PARI) a(n) = bitnegimply(n,n<<1); \\ _Kevin Ryde_, Feb 27 2021 %Y A229763 Cf. A003188 (n XOR floor(n/2)). %Y A229763 Cf. A048724 (n XOR (n*2)). %Y A229763 Cf. A048735 (n AND floor(n/2)). %Y A229763 Cf. A213370 (n AND (n*2)). %Y A229763 Cf. A213064 (n XOR (n*2) AND (n*2)). %Y A229763 Cf. A229762 (n XOR floor(n/2) AND floor(n/2), 1-bit below each run). %Y A229763 Cf. A292272 (high 1-bit each run). %K A229763 nonn,base,easy,look %O A229763 0,3 %A A229763 _Alex Ratushnyak_, Sep 28 2013