OFFSET
0,13
LINKS
FORMULA
A(n, k) = A(k, n).
A(n, 0) = 0.
A(n, 1) = 1 for any n > 0.
A(n, n) = n.
EXAMPLE
Table A(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 1 1 1 1 1 1 1 1 1 1 1 1 1 1
2 | 0 1 2 1 2 2 2 1 2 2 2 2 2 2 2 1
3 | 0 1 1 3 1 3 3 3 1 3 3 3 3 3 3 3
4 | 0 1 2 1 4 2 2 1 4 4 4 2 4 2 2 1
5 | 0 1 2 3 2 5 3 3 2 5 5 5 3 5 3 3
6 | 0 1 2 3 2 3 6 3 2 3 6 3 6 6 6 3
7 | 0 1 1 3 1 3 3 7 1 3 3 7 3 7 7 7
8 | 0 1 2 1 4 2 2 1 8 4 4 2 4 2 2 1
9 | 0 1 2 3 4 5 3 3 4 9 5 5 4 5 3 3
10 | 0 1 2 3 4 5 6 3 4 5 10 5 6 6 6 3
11 | 0 1 2 3 2 5 3 7 2 5 5 11 3 7 7 7
12 | 0 1 2 3 4 3 6 3 4 4 6 3 12 6 6 3
13 | 0 1 2 3 2 5 6 7 2 5 6 7 6 13 7 7
14 | 0 1 2 3 2 3 6 7 2 3 6 7 6 7 14 7
15 | 0 1 1 3 1 3 3 7 1 3 3 7 3 7 7 15
PROG
(PARI) A(n, k) = { my (sn = [0], bn = binary(n), sk = [0], bk = binary(k)); for (i = 1, #bn, sn = setunion(sn, [2*v+bn[i]|v<-sn])); for (i = 1, #bk, sk = setunion(sk, [2*v+bk[i]|v<-sk])); vecmax(setintersect(sn, sk)); }
CROSSREFS
KEYWORD
AUTHOR
Rémy Sigrist, Jul 07 2023
STATUS
approved