login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A229762 a(n) = (n XOR floor(n/2)) AND floor(n/2), where AND and XOR are bitwise logical operators. 2
0, 0, 1, 0, 2, 2, 1, 0, 4, 4, 5, 4, 2, 2, 1, 0, 8, 8, 9, 8, 10, 10, 9, 8, 4, 4, 5, 4, 2, 2, 1, 0, 16, 16, 17, 16, 18, 18, 17, 16, 20, 20, 21, 20, 18, 18, 17, 16, 8, 8, 9, 8, 10, 10, 9, 8, 4, 4, 5, 4, 2, 2, 1, 0, 32, 32, 33, 32, 34, 34, 33, 32, 36, 36, 37, 36, 34, 34, 33 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,5
COMMENTS
a(n) has a 01 bit pair in place of each 10 bit pair in n, and everywhere else 0 bits. Or equivalently a(n) has a 1-bit immediately below each run of 1's in n, but excluding a run ending at the least significant bit since below that is below the radix point. - Kevin Ryde, Feb 27 2021
LINKS
FORMULA
a(n) = (n XOR floor(n/2)) AND floor(n/2) = (n AND floor(n/2)) XOR floor(n/2).
a(n) = floor(n/2) AND NOT n. - Chai Wah Wu, Jun 29 2022
EXAMPLE
From Kevin Ryde, Feb 27 2021: (Start)
n = 7267 = binary 1110001100011
a(n) = 528 = binary 01000010000 1-bit below each run
(End)
PROG
(Python)
for n in range(333): print (n ^ (n>>1)) & (n>>1),
(Python)
def A229762(n): return ~n& n>>1 # Chai Wah Wu, Jun 29 2022
(Haskell)
import Data.Bits ((.&.), xor, shiftR)
a229762 n = (n `xor` shiftR n 1) .&. shiftR n 1 :: Int
-- Reinhard Zumkeller, Oct 10 2013
(PARI) a(n) = bitnegimply(n>>1, n); \\ Kevin Ryde, Feb 27 2021
CROSSREFS
Cf. A003188 (n XOR floor(n/2)).
Cf. A048724 (n XOR (n*2)).
Cf. A048735 (n AND floor(n/2)).
Cf. A213370 (n AND (n*2)).
Cf. A213064 (n XOR (n*2) AND (n*2), 1-bit above each run).
Cf. A229763 ((2*n) XOR n AND n, low 1-bit each run).
Sequence in context: A116389 A216344 A332011 * A062110 A122896 A191348
KEYWORD
nonn,base,easy
AUTHOR
Alex Ratushnyak, Sep 28 2013
STATUS
approved

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

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 19 21:09 EDT 2024. Contains 371798 sequences. (Running on oeis4.)