OFFSET
0,4
COMMENTS
In other words, A(n, k) encodes the sum of the polynomials encoded by n and k.
EXAMPLE
Array A(n, k) begins:
n\k| 0 1 2 3 4 5 6 7 8 9 10 11 12
---+------------------------------------------------------------
0| 0 1 2 3 4 5 6 7 8 9 10 11 12
1| 1 3 4 7 8 11 12 15 16 19 20 23 24
2| 2 4 12 8 24 19 28 16 48 35 44 39 56
3| 3 7 8 15 16 23 24 31 32 39 40 47 48
4| 4 8 24 16 48 39 56 32 96 71 88 79 112
5| 5 11 19 23 39 51 35 47 79 99 76 103 71
6| 6 12 28 24 56 35 60 48 112 67 92 71 120
7| 7 15 16 31 32 47 48 63 64 79 80 95 96
8| 8 16 48 32 96 79 112 64 192 143 176 159 224
9| 9 19 35 39 71 99 67 79 143 195 156 199 135
10| 10 20 44 40 88 76 92 80 176 156 204 152 184
11| 11 23 39 47 79 103 71 95 159 199 152 207 143
12| 12 24 56 48 112 71 120 96 224 135 184 143 240
PROG
(PARI) toruns(n) = { my (r=[]); while (n, my (v=valuation(n+n%2, 2)); n\=2^v; r=concat(v, r)); r }
fromruns(r) = { my (v=0); for (k=1, #r, v=(v+k%2)*2^r[k]-k%2); v }
A(n, k) = { fromruns(Vec(Pol(toruns(n)) + Pol(toruns(k)))) }
CROSSREFS
KEYWORD
AUTHOR
Rémy Sigrist, Jul 13 2022
STATUS
approved