A355340 a(0) = 0; for n >= 1, a(n) = a(n-1) XOR A001511(n), where XOR denotes bitwise exclusive-or (A003987) and A001511 is the binary ruler function.
0, 1, 3, 2, 1, 0, 2, 3, 7, 6, 4, 5, 6, 7, 5, 4, 1, 0, 2, 3, 0, 1, 3, 2, 6, 7, 5, 4, 7, 6, 4, 5, 3, 2, 0, 1, 2, 3, 1, 0, 4, 5, 7, 6, 5, 4, 6, 7, 2, 3, 1, 0, 3, 2, 0, 1, 5, 4, 6, 7, 4, 5, 7, 6, 1, 0, 2, 3, 0, 1, 3, 2, 6, 7, 5, 4, 7, 6, 4, 5, 0, 1, 3, 2, 1, 0, 2, 3, 7, 6, 4, 5, 6, 7, 5, 4, 2, 3, 1, 0, 3, 2, 0, 1, 5
Offset: 0
Examples
Initial terms arranged in periods of 16, with deliberate periodic spacing: 0,1,3,2, 1,0,2,3, 7,6,4,5, 6,7,5,4, 1,0,2,3, 0,1,3,2, 6,7,5,4, 7,6,4,5, 3,2,0,1, 2,3,1,0, 4,5,7,6, 5,4,6,7, 2,3,1,0, 3,2,0,1, 5,4,6,7, 4,5,7,6, . 1,0,2,3, 0,1,3,2, 6,7,5,4, 7,6,4,5, 0,1,3,2, 1,0,2,3, 7,6,4,5, 6,7,5,4, 2,3,1,0, 3,2,0,1, 5,4,6,7, 4,5,7,6, 3,2,0,1, 2,3,1,0, 4,5,7,6, 5,4,6,7, ... Note that when the arrangement is partitioned regularly into 2 X 2, 4 X 4 or 8 X 8 squares, the terms on any diagonal of a square share the same value. Note also the symmetry of the terms on the squares' circumferences.
Links
- Paolo Xausa, Table of n, a(n) for n = 0..16383
- Rémy Sigrist, Colored representation of the first 2^15 terms as 128 rows of 256 terms (the color is function of a(x + 256*y), x = 0..255, y = 0..127)
- Index entries for sequences related to binary expansion of n
Crossrefs
Programs
-
Mathematica
Block[{k = 0}, NestList[BitXor[#, IntegerExponent[k += 2, 2]] &, 0, 100]] (* Paolo Xausa, May 29 2024 *)
Comments