|
EXAMPLE
|
The top left {0..15} X {0..16} corner of the array:
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31,
2, 5, 6, 11, 10, 13, 14, 23, 18, 21, 22, 27, 26, 29, 30, 47,
3, 7, 11, 15, 19, 23, 27, 31, 35, 39, 43, 47, 51, 55, 59, 63,
4, 9, 10, 19, 12, 21, 22, 39, 20, 25, 26, 43, 28, 45, 46, 79,
5, 11, 13, 23, 21, 27, 29, 47, 37, 43, 45, 55, 53, 59, 61, 95,
6, 13, 14, 27, 22, 29, 30, 55, 38, 45, 46, 59, 54, 61, 62, 111,
7, 15, 23, 31, 39, 47, 55, 63, 71, 79, 87, 95, 103, 111, 119, 127,
8, 17, 18, 35, 20, 37, 38, 71, 24, 41, 42, 75, 44, 77, 78, 143,
9, 19, 21, 39, 25, 43, 45, 79, 41, 51, 53, 87, 57, 91, 93, 159,
10, 21, 22, 43, 26, 45, 46, 87, 42, 53, 54, 91, 58, 93, 94, 175,
11, 23, 27, 47, 43, 55, 59, 95, 75, 87, 91, 111, 107, 119, 123, 191,
12, 25, 26, 51, 28, 53, 54, 103, 44, 57, 58, 107, 60, 109, 110, 207,
13, 27, 29, 55, 45, 59, 61, 111, 77, 91, 93, 119, 109, 123, 125, 223,
14, 29, 30, 59, 46, 61, 62, 119, 78, 93, 94, 123, 110, 125, 126, 239,
15, 31, 47, 63, 79, 95, 111, 127, 143, 159, 175, 191, 207, 223, 239, 255,
16, 33, 34, 67, 36, 69, 70, 135, 40, 73, 74, 139, 76, 141, 142, 271,
...
We consider the case of n = 10, k = 41, following the procedure in the Feb 14 2021 comment.
First, write 10 and 41 in binary:
10 = 1010_2
41 = 101001_2
Add at least one leading zero to each number, equalizing number of zeros:
0 0 1 0 1 0
0 1 0 1 0 0 1
Align zeros, but separate ones:
0 0 1 0 1 0
| | | |
0 1 0 1 0 0 1
---------------------------
0 1 0 1 1 0 1 0 1
Concatenating the ones, as shown above, we get 10110101_2 = 181.
So A(10, 41) = 181.
(End)
|