login

Revision History for A165199

(Bold, blue-underlined text is an ; faded, red-underlined text is a deletion.)

Showing entries 1-10 | older changes
a(n) is obtained by flipping every second bit in the binary representation of n starting at the second-most significant bit and on downwards.
(history; published version)
#48 by Peter Luschny at Wed Oct 11 04:40:14 EDT 2023
STATUS

reviewed

#47 by Joerg Arndt at Wed Oct 11 04:26:31 EDT 2023
STATUS

proposed

#46 by Michel Marcus at Wed Oct 11 04:13:55 EDT 2023
STATUS

editing

#45 by Michel Marcus at Wed Oct 11 04:13:51 EDT 2023
COMMENTS

From Emeric Deutsch, Oct 06 2020 (Start)

STATUS

approved

#44 by Alois P. Heinz at Thu Oct 08 20:08:38 EDT 2020
STATUS

editing

#43 by Alois P. Heinz at Thu Oct 08 05:30:27 EDT 2020
EXAMPLE

a(12) = 9, because 12 = 1100_2 and 1100_2 XOR 0101_2 = 1001_2 = 9.

#42 by Alois P. Heinz at Thu Oct 08 05:24:57 EDT 2020
NAME

a(0) = 0, and for n>=1, let b(n,m) be the m-th digit, reading left to right, of binary n. (b(n, 1) is the most significant binary digit, which is 1.) Then a(n) is such that b(a(n),1)=1; and if b(n,m)=b(n,m-1) then b(a(n),m) does not = b(a(n),m-1); and if b(n,m) does not = b(n,m-1) then b(a(n), m) = b(a(n),m-1), for all m where 2 <= m <= number binary digits in n.

COMMENTS

a(n) is obtained by flipping every second bit in the binary representation of n starting at the second-most significant bit and on downwards. - Kevin Ryde, Oct 07 2020

EXAMPLE

12 in binary is 1100. Generating a(12): the leftmost binary digit is 1. In 1100, the 2nd digit from the left equals the first, so the second digit from the left of binary a(12) does not equal the first; so we have 10 as the two leftmost digits in binary a(12). The third digit from the left of binary 12 does not equal the second, so the third digit from the left of binary a(12) equals the second; therefore the leftmost 3 digits of a(12) in binary are 100. And finally, the rightmost digit of binary 12 equals the 3rd from the left, so the rightmost digit of binary a(12) does not equal the 3rd from the left of binary a(12). Therefore a(12) in binary is 1001. And a(12) is the decimal equivalent of this, which is 9.

EXTENSIONS

#41 by Kevin Ryde at Wed Oct 07 17:32:23 EDT 2020
PROG

Discussion
Wed Oct 07
17:34
Kevin Ryde: Can also div-by-3 for the bits in Pari.  More efficient, less obvious :).
Thu Oct 08
01:45
Hugo Pfoertner: A provocative question: am I the only one who has difficulty understanding the current title? A 5-line title is also completely useless for the usual mouse-over display. Should we consider swapping the title for Kevin's definition and moving the current title to the first comment?
05:22
Alois P. Heinz: your are right, Hugo
#40 by Alois P. Heinz at Wed Oct 07 15:04:25 EDT 2020
MAPLE

#39 by Hugo Pfoertner at Wed Oct 07 14:27:14 EDT 2020
COMMENTS

Discussion
Wed Oct 07
14:30
Hugo Pfoertner: Copied Kevin Ryde's pink box comment from A338019, which was the basis of my PARI program.
14:36
Alois P. Heinz: yes, thanks Hugo