login
A344836
Square array T(n, k), n, k >= 0, read by antidiagonals; T(n, k) = (n * 2^max(0, w(k)-w(n))) XOR (k * 2^max(0, w(n)-w(k))) (where XOR denotes the bitwise XOR operator and w = A070939).
6
0, 1, 1, 2, 0, 2, 3, 0, 0, 3, 4, 1, 0, 1, 4, 5, 0, 1, 1, 0, 5, 6, 1, 0, 0, 0, 1, 6, 7, 2, 1, 2, 2, 1, 2, 7, 8, 3, 2, 3, 0, 3, 2, 3, 8, 9, 0, 3, 0, 1, 1, 0, 3, 0, 9, 10, 1, 0, 1, 2, 0, 2, 1, 0, 1, 10, 11, 2, 1, 4, 3, 3, 3, 3, 4, 1, 2, 11, 12, 3, 2, 5, 0, 2, 0, 2, 0, 5, 2, 3, 12
OFFSET
0,4
COMMENTS
In other words, we right pad the binary expansion of the lesser of n and k with zeros (provided it is positive) so that both numbers have the same number of binary digits, and then apply the bitwise XOR operator.
FORMULA
T(n, k) = T(k, n).
T(n, n) = 0.
T(n, 0) = n.
T(n, 1) = A053645(n) for any n > 0.
EXAMPLE
Array T(n, k) begins:
n\k| 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
---+-------------------------------------------------------
0| 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
1| 1 0 0 1 0 1 2 3 0 1 2 3 4 5 6 7
2| 2 0 0 1 0 1 2 3 0 1 2 3 4 5 6 7
3| 3 1 1 0 2 3 0 1 4 5 6 7 0 1 2 3
4| 4 0 0 2 0 1 2 3 0 1 2 3 4 5 6 7
5| 5 1 1 3 1 0 3 2 2 3 0 1 6 7 4 5
6| 6 2 2 0 2 3 0 1 4 5 6 7 0 1 2 3
7| 7 3 3 1 3 2 1 0 6 7 4 5 2 3 0 1
8| 8 0 0 4 0 2 4 6 0 1 2 3 4 5 6 7
9| 9 1 1 5 1 3 5 7 1 0 3 2 5 4 7 6
10| 10 2 2 6 2 0 6 4 2 3 0 1 6 7 4 5
11| 11 3 3 7 3 1 7 5 3 2 1 0 7 6 5 4
12| 12 4 4 0 4 6 0 2 4 5 6 7 0 1 2 3
13| 13 5 5 1 5 7 1 3 5 4 7 6 1 0 3 2
14| 14 6 6 2 6 4 2 0 6 7 4 5 2 3 0 1
15| 15 7 7 3 7 5 3 1 7 6 5 4 3 2 1 0
PROG
(PARI) T(n, k, op=bitxor, w=m->#binary(m)) = { op(n*2^max(0, w(k)-w(n)), k*2^max(0, w(n)-w(k))) }
CROSSREFS
Cf. A344834 (AND), A344835 (OR), A344837 (min), A344838 (max), A344839 (absolute difference).
Sequence in context: A144217 A187881 A344839 * A323474 A132814 A058623
KEYWORD
nonn,base,tabl
AUTHOR
Rémy Sigrist, May 29 2021
STATUS
approved