

A243589


Numbers returned when each binary digit of n is replaced by the sum modulo 2 of the digits to its (wrapped) left and (wrapped) right.


1



0, 0, 0, 3, 5, 6, 0, 5, 15, 0, 10, 15, 5, 10, 0, 9, 27, 12, 30, 3, 17, 6, 20, 29, 15, 24, 10, 23, 5, 18, 0, 17, 51, 20, 54, 27, 57, 30, 60, 5, 39, 0, 34, 15, 45, 10, 40, 57, 27, 60, 30, 51, 17, 54, 20, 45, 15, 40, 10, 39, 5, 34, 0, 33, 99, 36, 102, 43, 105, 46
(list;
graph;
refs;
listen;
history;
text;
internal format)



OFFSET

1,4


COMMENTS

a(n) = ror(n) XOR rol(n), where ror(x)=A038572(x) is x rotated one binary place to the right, rol(x)=A006257(x) is x rotated one binary place to the left, and XOR is the binary exclusiveor operator.  Alex Ratushnyak, May 24 2016
Numbers returned by the following function: take the t binary digits of n, d(1)..d(t), and replace each with the sum d(i) = (d(i1) + d(i+1)) mod 2, where (i1 = 0) maps to t and (i+1 > t) maps to 1.


LINKS

Anthony Sand, Table of n, a(n) for n = 1..1000


FORMULA

for digits d(1)..d(t), d(i) = (d(i1) + d(i+1)) mod 2, where (i1 = 0) > t, (i+1 > t) > 1.


EXAMPLE

For 1, the function returns d(1) = (d(1) + d(1)) mod 2 = (1 + 1) mod 2 = 0.
For 5, the initial digits are (1,0,1).
d(1) = (d(3) + d(2)) mod 2 = (1 + 0) mod 2 = 1; d(2) = (d(1) + d(3)) mod 2 = (1 + 1) mod 2 = 0; d(3) = (d(2) + d(1)) mod 2 = (0 + 1) mod 2 = 1.
The function returns (1,0,1) = 101 = 5 in base 10.


PROG

(Python)
for n in range(1, 100):
BL = len(bin(n))2
x = (n>>1) + ((n&1) << (BL1)) # A038572(n)
x^= (n*2)  (1<<BL) + 1 # A006257(n) for n>0
print str(x)+', ',


CROSSREFS

Cf. A006257, A035327, A038572, A055120.
Sequence in context: A186969 A111950 A274792 * A178255 A154467 A152713
Adjacent sequences: A243586 A243587 A243588 * A243590 A243591 A243592


KEYWORD

nonn,easy,base,look


AUTHOR

Anthony Sand, Jun 07 2014


STATUS

approved



