OFFSET
0,8
COMMENTS
The set of nonnegative integers equipped with A form a commutative monoid.
FORMULA
EXAMPLE
Array A(n, k) begins:
n\k | 0 1 2 3 4 5 6 7 8 9 10
----+-------------------------------------------------------------
0 | 0 0 0 0 0 0 0 0 0 0 0
1 | 0 1 2 3 4 5 6 7 8 9 10
2 | 0 2 8 10 32 34 40 42 128 130 136
3 | 0 3 10 9 36 39 46 45 136 139 130
4 | 0 4 32 36 256 260 288 292 2048 2052 2080
5 | 0 5 34 39 260 257 294 291 2056 2061 2090
6 | 0 6 40 46 288 294 264 270 2176 2182 2216
7 | 0 7 42 45 292 291 270 265 2184 2191 2210
8 | 0 8 128 136 2048 2056 2176 2184 32768 32776 32896
9 | 0 9 130 139 2052 2061 2182 2191 32776 32769 32906
10 | 0 10 136 130 2080 2090 2216 2210 32896 32906 32776
PROG
(PARI) bits(n) = { my (b=vector(hammingweight(n))); for (k=1, #b, n-=2^b[k]=valuation(n, 2)); return (b); }
A(n, k) = { my (bn = bits(2*n), bk = bits(2*k), v = 0, e); for (i = 1, #bn, for (j = 1, #bk, e = bn[i] * bk[j] - 1; v = bitxor(v, 2^e); ); ); return (v); }
CROSSREFS
KEYWORD
AUTHOR
Rémy Sigrist, Apr 30 2024
STATUS
approved