OFFSET
1,5
COMMENTS
Row sums are: 1, 2, 4, 8, 14, 20, 26, 32, 58, 64, 86,....
LINKS
Eric W. Weisstein’s World of Mathematics, Gray Code
EXAMPLE
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;
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[%]
CROSSREFS
KEYWORD
nonn,tabl
AUTHOR
Roger L. Bagula, May 18 2010
EXTENSIONS
Edited by R. J. Mathar, Mar 10 2015
STATUS
approved