|
|
A261349
|
|
T(n,k) is the decimal equivalent of a code for k that maximizes the sum of the Hamming distances between (cyclical) adjacent code words; triangle T(n,k), n>=0, 0<=k<=2^n-1, read by rows.
|
|
1
|
|
|
0, 0, 1, 0, 3, 1, 2, 0, 7, 1, 6, 3, 4, 2, 5, 0, 15, 1, 14, 3, 12, 2, 13, 6, 9, 7, 8, 5, 10, 4, 11, 0, 31, 1, 30, 3, 28, 2, 29, 6, 25, 7, 24, 5, 26, 4, 27, 12, 19, 13, 18, 15, 16, 14, 17, 10, 21, 11, 20, 9, 22, 8, 23, 0, 63, 1, 62, 3, 60, 2, 61, 6, 57, 7, 56, 5
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,5
|
|
COMMENTS
|
This code might be called "Anti-Gray code".
The sum of the Hamming distances between (cyclical) adjacent code words of row n gives 0, 2, 6, 20, 56, 144, 352, ... = A014480(n-1) for n>1.
|
|
LINKS
|
|
|
FORMULA
|
T(n,k) = A003188(k/2) if k even, T(n,k) = 2^n-1-A003188((k-1)/2) else.
|
|
EXAMPLE
|
Triangle T(n,k) begins:
0;
0, 1;
0, 3, 1, 2;
0, 7, 1, 6, 3, 4, 2, 5;
0, 15, 1, 14, 3, 12, 2, 13, 6, 9, 7, 8, 5, 10, 4, 11;
0, 31, 1, 30, 3, 28, 2, 29, 6, 25, 7, 24, 5, 26, 4, 27, 12, 19, ... ;
0, 63, 1, 62, 3, 60, 2, 61, 6, 57, 7, 56, 5, 58, 4, 59, 12, 51, ... ;
|
|
MAPLE
|
g:= n-> Bits[Xor](n, iquo(n, 2)):
T:= (n, k)-> (t-> `if`(m=0, t, 2^n-1-t))(g(iquo(k, 2, 'm'))):
seq(seq(T(n, k), k=0..2^n-1), n=0..6);
|
|
CROSSREFS
|
|
|
KEYWORD
|
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|