OFFSET
0,4
COMMENTS
The array T is associative.
FORMULA
EXAMPLE
Array T(n, k) begins (in decimal):
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 2 5 4 11 10 9 8 23 22 21 20 19
2| 2 5 10 11 20 21 22 23 40 41 42 43 44
3| 3 6 13 12 27 26 25 24 55 54 53 52 51
4| 4 9 18 19 36 37 38 39 72 73 74 75 76
5| 5 10 21 20 43 42 41 40 87 86 85 84 83
6| 6 13 26 27 52 53 54 55 104 105 106 107 108
7| 7 14 29 28 59 58 57 56 119 118 117 116 115
8| 8 17 34 35 68 69 70 71 136 137 138 139 140
Array T(n, k) begins (in binary):
n\k | 0 1 10 11 100 101 110 111 1000
----+---------------------------------------------------------------------------
0| 0 1 10 11 100 101 110 111 1000
1| 1 10 101 100 1011 1010 1001 1000 10111
10| 10 101 1010 1011 10100 10101 10110 10111 101000
11| 11 110 1101 1100 11011 11010 11001 11000 110111
100| 100 1001 10010 10011 100100 100101 100110 100111 1001000
101| 101 1010 10101 10100 101011 101010 101001 101000 1010111
110| 110 1101 11010 11011 110100 110101 110110 110111 1101000
111| 111 1110 11101 11100 111011 111010 111001 111000 1110111
1000| 1000 10001 100010 100011 1000100 1000101 1000110 1000111 10001000
PROG
(PARI) torl(n) = my (r=[]); while (n, r = concat(valuation(n+(n%2), 2), r); n \= 2^r[1]; ); r
fromrl(r) = my (v=0); for (i=1, #r, v = (v + (i%2))*2^r[i]-(i%2)); v
T(n, k) = fromrl(concat(torl(n), torl(k)))
CROSSREFS
KEYWORD
AUTHOR
Rémy Sigrist, Dec 01 2018
STATUS
approved