cp's OEIS Frontend

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.

Showing 1-3 of 3 results.

A292272 a(n) = n - A048735(n) = n - (n AND floor(n/2)).

Original entry on oeis.org

0, 1, 2, 2, 4, 5, 4, 4, 8, 9, 10, 10, 8, 9, 8, 8, 16, 17, 18, 18, 20, 21, 20, 20, 16, 17, 18, 18, 16, 17, 16, 16, 32, 33, 34, 34, 36, 37, 36, 36, 40, 41, 42, 42, 40, 41, 40, 40, 32, 33, 34, 34, 36, 37, 36, 36, 32, 33, 34, 34, 32, 33, 32, 32, 64, 65, 66, 66, 68, 69, 68, 68, 72, 73, 74, 74, 72, 73, 72, 72, 80, 81, 82, 82, 84, 85, 84, 84, 80, 81, 82, 82, 80, 81
Offset: 0

Views

Author

Antti Karttunen, Sep 16 2017

Keywords

Comments

In binary expansion of n, change those 1's to 0's that have an 1-bit next to them at their left (more significant) side. Only fibbinary numbers (A003714) occur as terms.

Examples

			From _Kevin Ryde_, Jun 02 2020: (Start)
     n = 1831 = binary 11100100111
  a(n) = 1060 = binary 10000100100   high 1 of each run
(End)
		

Crossrefs

Programs

Formula

a(n) = n - A048735(n) = n - (n AND floor(n/2)) = n XOR (n AND floor(n/2)), where AND is bitwise-AND (A004198) and XOR is bitwise-XOR (A003987).
a(n) = n AND A003188(n).
a(n) = A292382(A005940(1+n)).
A059905(a(n)) = A292371(n).
For all n >= 0, A085357(a(n)) = 1.
a(n) = A213064(n) / 2. - Kevin Ryde, Jun 02 2020
a(n) = n AND NOT floor(n/2). - Chai Wah Wu, Jun 29 2022

A229762 a(n) = (n XOR floor(n/2)) AND floor(n/2), where AND and XOR are bitwise logical operators.

Original entry on oeis.org

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
Offset: 0

Views

Author

Alex Ratushnyak, Sep 28 2013

Keywords

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

Examples

			From _Kevin Ryde_, Feb 27 2021: (Start)
     n = 7267 = binary 1110001100011
  a(n) =  528 = binary   01000010000   1-bit below each run
(End)
		

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).

Programs

  • 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
  • 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
    

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

A229763 a(n) = (2*n) XOR n AND n, where AND and XOR are bitwise logical operators.

Original entry on oeis.org

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, 5, 2, 1, 32, 33, 34, 33, 36, 37, 34, 33, 40, 41, 42, 41, 36, 37, 34, 33, 16, 17, 18, 17, 20, 21, 18, 17, 8, 9, 10, 9, 4, 5, 2, 1, 64, 65, 66, 65, 68, 69, 66, 65, 72, 73, 74
Offset: 0

Views

Author

Alex Ratushnyak, Sep 28 2013

Keywords

Comments

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

Examples

			From _Kevin Ryde_, Feb 27 2021: (Start)
     n = 1831 = binary 11100100111
  a(n) =  289 = binary   100100001   low 1-bit each run
(End)
		

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)).
Cf. A229762 (n XOR floor(n/2) AND floor(n/2), 1-bit below each run).
Cf. A292272 (high 1-bit each run).

Programs

  • Haskell
    import Data.Bits ((.&.), xor, shiftL)
    a229763 n = (shiftL n 1 `xor` n) .&. n :: Int
    -- Reinhard Zumkeller, Oct 10 2013
    
  • Mathematica
    Array[BitAnd[BitXor[2 #, #], #] &, 75, 0] (* Michael De Vlieger, Nov 03 2022 *)
  • PARI
    a(n) = bitnegimply(n,n<<1); \\ Kevin Ryde, Feb 27 2021
  • Python
    for n in range(333): print (2*n ^ n) & n,
    
  • Python
    def A229763(n): return n&~(n<<1) # Chai Wah Wu, Jun 29 2022
    

Formula

a(n) = ((2*n) XOR n) AND n = ((2*n) AND n) XOR n.
a(2n) = 2a(n), a(2n+1) = A229762(n). - Ralf Stephan, Oct 07 2013
a(n) = n AND NOT 2n. - Chai Wah Wu, Jun 29 2022
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
Showing 1-3 of 3 results.