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 take the greatest value.
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
T(n, k) = T(k, n).
T(m, T(n, k)) = T(T(m, n), k).
T(n, n) = n.
T(n, 0) = n.
T(n, 1) = max(1, n).
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 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
2| 2 2 2 3 4 5 6 7 8 9 10 11 12 13 14 15
3| 3 3 3 3 6 6 6 7 12 12 12 12 12 13 14 15
4| 4 4 4 6 4 5 6 7 8 9 10 11 12 13 14 15
5| 5 5 5 6 5 5 6 7 10 10 10 11 12 13 14 15
6| 6 6 6 6 6 6 6 7 12 12 12 12 12 13 14 15
7| 7 7 7 7 7 7 7 7 14 14 14 14 14 14 14 15
8| 8 8 8 12 8 10 12 14 8 9 10 11 12 13 14 15
9| 9 9 9 12 9 10 12 14 9 9 10 11 12 13 14 15
10| 10 10 10 12 10 10 12 14 10 10 10 11 12 13 14 15
11| 11 11 11 12 11 11 12 14 11 11 11 11 12 13 14 15
12| 12 12 12 12 12 12 12 14 12 12 12 12 12 13 14 15
13| 13 13 13 13 13 13 13 14 13 13 13 13 13 13 14 15
14| 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 15
15| 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15
PROG
(PARI) T(n, k, op=max, 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