|
|
A268676
|
|
a(n) = A101080(n,A268823(3+n)), where A101080(x,y) gives the Hamming distance between binary expansions of x and y.
|
|
3
|
|
|
1, 3, 3, 1, 3, 1, 1, 3, 3, 1, 1, 3, 1, 3, 3, 1, 3, 1, 1, 3, 1, 3, 3, 1, 1, 3, 3, 1, 3, 1, 1, 3, 3, 1, 1, 3, 1, 3, 3, 1, 1, 3, 3, 1, 3, 1, 1, 3, 1, 3, 3, 1, 3, 1, 1, 3, 3, 1, 1, 3, 1, 3, 3, 1, 3, 1, 1, 3, 1, 3, 3, 1, 1, 3, 3, 1, 3, 1, 1, 3, 1, 3, 3, 1, 3, 1, 1, 3, 3, 1, 1, 3, 1, 3, 3, 1, 1, 3, 3, 1, 3, 1, 1, 3, 3, 1, 1, 3, 1, 3, 3, 1, 3, 1, 1, 3, 1, 3, 3, 1, 1
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,2
|
|
COMMENTS
|
It seems that A001969 gives the positions of 1's, while A000069 gives the positions of 3's.
The above observation follows because by definition, a(n) gives the Hamming distance between binary expansions of n and A003188(3+A006068(n)). To see how this leads to the stated claim, consider the illustration "Visualized as a traversal of vertices of a tesseract" in the Wikipedia article "Gray code". Starting from any vertex with either (A) an even, or (B) an odd number of 1-bits, traverse three edges along the red path, to the direction indicated by the arrow, and then note the Hamming distance between the starting and the ending vertex. It is always 1 in case (A), and 3 in case (B), because the position of the flipped bit is given by sequence A007814, with its every other term zero, so in case (A) the third flip cancels the first flip (both toggling the rightmost bit), which leaves only the second bit-flip effective. Note that the properties of a tesseract generalize to those of an infinite dimensional hypercube. - Antti Karttunen, Mar 11 2024
|
|
LINKS
|
|
|
FORMULA
|
a(n) = A101080(n,A268823(3+n)), where A101080(x,y) gives the Hamming distance between binary expansions of x and y.
|
|
MAPLE
|
a := n -> 2-(-1)^add(convert(n, base, 2)):
|
|
PROG
|
;; Where A101080bi implements the dyadic function A101080(x, y) which gives the Hamming distance between binary expansions of x and y.
(PARI)
A006068(n) = { my(s=1, ns); while(1, ns = n >> s; if(0==ns, return(n)); n = bitxor(n, ns); s <<= 1); };
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|