A178059 Triangle read by rows: Number of 1's in the Gray code of Eulerian(n,m), 1<=m<=n.
1, 1, 1, 1, 2, 1, 1, 3, 3, 1, 1, 4, 4, 4, 1, 1, 3, 6, 6, 3, 1, 1, 2, 7, 6, 7, 2, 1, 1, 3, 7, 5, 5, 7, 3, 1, 1, 4, 6, 14, 8, 14, 6, 4, 1, 1, 5, 8, 8, 10, 10, 8, 8, 5, 1, 1, 4, 11, 8, 14, 10, 14, 8, 11, 4, 1
Offset: 1
Examples
1; 1, 1; 1, 2, 1; 1, 3, 3, 1; 1, 4, 4, 4, 1; 1, 3, 6, 6, 3, 1; 1, 2, 7, 6, 7, 2, 1; 1, 3, 7, 5, 5, 7, 3, 1; 1, 4, 6, 14, 8, 14, 6, 4, 1; 1, 5, 8, 8, 10, 10, 8, 8, 5, 1; 1, 4, 11, 8, 14, 10, 14, 8, 11, 4, 1;
Links
- Eric W. Weisstein’s World of Mathematics, Gray Code
Programs
-
Mathematica
<< DiscreteMath`Combinatorica` 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 ] Table[Table[Apply[Plus, GrayCodeList[Eulerian[n+1, m]]], {m, 0, n}], {n, 0, 10}]; Flatten[%]
Extensions
Edited by R. J. Mathar, Mar 10 2015
Comments