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.

A178059 Triangle read by rows: Number of 1's in the Gray code of Eulerian(n,m), 1<=m<=n.

Original entry on oeis.org

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

Views

Author

Roger L. Bagula, May 18 2010

Keywords

Comments

Row sums are: 1, 2, 4, 8, 14, 20, 26, 32, 58, 64, 86,....

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;
		

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[%]

Formula

T(n,m) = A005811(A008292(n,m)).

Extensions

Edited by R. J. Mathar, Mar 10 2015