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.

A377404 In the binary expansion of n, replace the first, third, fifth, etc. 1's by 0's.

Original entry on oeis.org

0, 0, 0, 1, 0, 1, 2, 2, 0, 1, 2, 2, 4, 4, 4, 5, 0, 1, 2, 2, 4, 4, 4, 5, 8, 8, 8, 9, 8, 9, 10, 10, 0, 1, 2, 2, 4, 4, 4, 5, 8, 8, 8, 9, 8, 9, 10, 10, 16, 16, 16, 17, 16, 17, 18, 18, 16, 17, 18, 18, 20, 20, 20, 21, 0, 1, 2, 2, 4, 4, 4, 5, 8, 8, 8, 9, 8, 9, 10, 10
Offset: 0

Views

Author

Rémy Sigrist, Oct 28 2024

Keywords

Comments

Each 1 in the binary expansion of n appears either in a(n) or in A265263(n).

Examples

			The first terms, in decimal and in binary, are:
  n   a(n)  bin(n)  bin(a(n))
  --  ----  ------  ---------
   0     0       0          0
   1     0       1          0
   2     0      10          0
   3     1      11          1
   4     0     100          0
   5     1     101          1
   6     2     110         10
   7     2     111         10
   8     0    1000          0
   9     1    1001          1
  10     2    1010         10
  11     2    1011         10
  12     4    1100        100
  13     4    1101        100
  14     4    1110        100
  15     5    1111        101
		

Crossrefs

Programs

  • PARI
    a(n) = { my (b = binary(n), h = 0); for (i = 1, #b, if (b[i] && h++%2==1, b[i]
    = 0;);); fromdigits(b, 2); }

Formula

a(n) = n - A265263(n).
a(2*n) = 2*a(n).
A000120(a(n)) = floor(A000120(n)/2).