OFFSET
0,8
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 AND operator.
LINKS
Rémy Sigrist, Table of n, a(n) for n = 0..10010
Rémy Sigrist, Colored representation of the table for n, k < 2^10
FORMULA
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 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
1| 0 1 2 2 4 4 4 4 8 8 8 8 8 8 8 8
2| 0 2 2 2 4 4 4 4 8 8 8 8 8 8 8 8
3| 0 2 2 3 4 4 6 6 8 8 8 8 12 12 12 12
4| 0 4 4 4 4 4 4 4 8 8 8 8 8 8 8 8
5| 0 4 4 4 4 5 4 5 8 8 10 10 8 8 10 10
6| 0 4 4 6 4 4 6 6 8 8 8 8 12 12 12 12
7| 0 4 4 6 4 5 6 7 8 8 10 10 12 12 14 14
8| 0 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8
9| 0 8 8 8 8 8 8 8 8 9 8 9 8 9 8 9
10| 0 8 8 8 8 10 8 10 8 8 10 10 8 8 10 10
11| 0 8 8 8 8 10 8 10 8 9 10 11 8 9 10 11
12| 0 8 8 12 8 8 12 12 8 8 8 8 12 12 12 12
13| 0 8 8 12 8 8 12 12 8 9 8 9 12 13 12 13
14| 0 8 8 12 8 10 12 14 8 8 10 10 12 12 14 14
15| 0 8 8 12 8 10 12 14 8 9 10 11 12 13 14 15
PROG
(PARI) T(n, k, op=bitand, w=m->#binary(m)) = { op(n*2^max(0, w(k)-w(n)), k*2^max(0, w(n)-w(k))) }
CROSSREFS
KEYWORD
AUTHOR
Rémy Sigrist, May 29 2021
STATUS
approved