cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

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.

This page as a plain text file.
%I A261349 #34 Sep 05 2018 16:16:22
%S A261349 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,
%T A261349 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,
%U A261349 21,11,20,9,22,8,23,0,63,1,62,3,60,2,61,6,57,7,56,5
%N 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.
%C A261349 This code might be called "Anti-Gray code".
%C A261349 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.
%H A261349 Alois P. Heinz, <a href="/A261349/b261349.txt">Rows n = 0..13, flattened</a>
%H A261349 Wikipedia, <a href="https://en.wikipedia.org/wiki/Gray_code">Gray code</a>
%H A261349 Wikipedia, <a href="https://en.wikipedia.org/wiki/Hamming_distance">Hamming distance</a>
%F A261349 T(n,k) = A003188(k/2) if k even, T(n,k) = 2^n-1-A003188((k-1)/2) else.
%F A261349 A101080(T(n,2k),T(n,2k+1)) = n, A101080(T(n,2k),T(n,2k-1)) = n-1.
%F A261349 T(n,2^n-1) = A083329(n-1) for n>0.
%F A261349 T(n,2^n-2) = A000079(n-2) for n>1.
%F A261349 T(2n,2n) = A003188(n).
%F A261349 T(2n+1,2n+1) = 2*4^n - 1 - A003188(n) = A083420(n) - A003188(n).
%e A261349 Triangle T(n,k) begins:
%e A261349   0;
%e A261349   0,  1;
%e A261349   0,  3, 1,  2;
%e A261349   0,  7, 1,  6, 3,  4, 2,  5;
%e A261349   0, 15, 1, 14, 3, 12, 2, 13, 6,  9, 7,  8, 5, 10, 4, 11;
%e A261349   0, 31, 1, 30, 3, 28, 2, 29, 6, 25, 7, 24, 5, 26, 4, 27, 12, 19, ... ;
%e A261349   0, 63, 1, 62, 3, 60, 2, 61, 6, 57, 7, 56, 5, 58, 4, 59, 12, 51, ... ;
%p A261349 g:= n-> Bits[Xor](n, iquo(n, 2)):
%p A261349 T:= (n, k)-> (t-> `if`(m=0, t, 2^n-1-t))(g(iquo(k, 2, 'm'))):
%p A261349 seq(seq(T(n, k), k=0..2^n-1), n=0..6);
%Y A261349 Columns k=0-3 give: A000004, A000225, A000012 (for n>1), A000918 (for n>1).
%Y A261349 Row lengths give A000079.
%Y A261349 Row sums give A006516.
%Y A261349 Cf. A003188, A014480, A083329, A083420, A101080.
%K A261349 nonn,look,tabf,easy
%O A261349 0,5
%A A261349 _Alois P. Heinz_, Nov 18 2015