%I #10 Mar 10 2015 07:40:13
%S 1,1,1,1,6,1,1,14,14,1,1,23,99,23,1,1,37,441,441,37,1,1,68,244,456,
%T 244,68,1,1,140,167,386,386,167,140,1,1,269,408,255,785,255,408,269,1,
%U 1,527,912,788,987,987,788,912,527,1
%N Triangle read by rows: Gray code of Eulerian(n,m), 1<=m<=n.
%C Row sums are: 1, 2, 8, 30, 147, 958, 1082, 1388, 2651, 6430,...
%H Eric W. Weisstein, <a href="http://mathworld.wolfram.com/GrayCode.html">Gray Code</a>
%F T(n,m) = A003188(A008292(n,m)). - _R. J. Mathar_, Mar 10 2015
%e 1;
%e 1, 1;
%e 1, 6, 1;
%e 1, 14, 14, 1;
%e 1, 23, 99, 23, 1;
%e 1, 37, 441, 441, 37, 1;
%e 1, 68, 244, 456, 244, 68, 1;
%e 1, 140, 167, 386, 386, 167, 140, 1;
%e 1, 269, 408, 255, 785, 255, 408, 269, 1;
%e 1, 527, 912, 788, 987, 987, 788, 912, 527, 1;
%t Code GrayCodeList[k_] := Module[{b = IntegerDigits[k, 2], i}, Do[ If[b[[i - 1]] == 1, b[[i]] = 1 - b[[i]]], {i, Length[b], 2, -1} ]; b ]; FromGrayCodeList[d_] := Module[{b = d, i, j}, Do[ If[Mod[Sum[b[[j]], {j, i - 1}], 2] == 1, b[[i]] = 1 - b[[i]]], {i, n = Length[d], 2, -1} ]; FromDigits[b, 2] ]; GrayCode[i_, n_] := FromDigits[BitXor @@@ Partition[Prepend[ IntegerDigits[i, 2, n], 0], 2, 1], 2] FromGrayCode[i_, n_] := FromDigits[BitXor[IntegerDigits[i, 2, n], FoldList[ BitXor, 0, Most[IntegerDigits[i, 2, n]]]], 2]; Clear[f, a, n, m, x]; (*A123125*) f[x_, n_] := f[x, n] = (1 - x)^(n + 1)*Sum[k^n*x^k, {k, 0, Infinity}]/x; Table[FullSimplify[ExpandAll[f[x, n]]], {n, 0, 10}]; a = Table[CoefficientList[FullSimplify[ExpandAll[f[x, n]]], x], {n, 1, 10}]; Table[Flatten[Table[GrayCode[a[[n]][[m]], 10], {m, 1, n}]], {n, 1, Length[ a]}]; Flatten[%]
%Y Cf. A178059.
%K nonn,tabl
%O 1,5
%A _Roger L. Bagula_ and _Gary W. Adamson_, Oct 20 2008
%E Edited by _R. J. Mathar_, Mar 10 2015