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.

A178058 Number of 1's in the Gray code for binomial(n,m).

Original entry on oeis.org

1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 2, 2, 2, 1, 1, 3, 4, 4, 3, 1, 1, 2, 1, 4, 1, 2, 1, 1, 1, 5, 3, 3, 5, 1, 1, 1, 2, 2, 2, 4, 2, 2, 2, 1, 1, 3, 4, 6, 2, 2, 6, 4, 3, 1, 1, 4, 5, 2, 6, 2, 6, 2, 5, 4, 1
Offset: 0

Views

Author

Roger L. Bagula, May 18 2010

Keywords

Comments

Row sums are: 1, 2, 4, 4, 8, 16, 12, 20, 18, 32, 38,....

Examples

			1;
1, 1;
1, 2, 1;
1, 1, 1, 1;
1, 2, 2, 2, 1;
1, 3, 4, 4, 3, 1;
1, 2, 1, 4, 1, 2, 1;
1, 1, 5, 3, 3, 5, 1, 1;
1, 2, 2, 2, 4, 2, 2, 2, 1;
1, 3, 4, 6, 2, 2, 6, 4, 3, 1;
1, 4, 5, 2, 6, 2, 6, 2, 5, 4, 1;
		

Crossrefs

Cf. A143214.

Programs

  • Maple
    A178058 := proc(n,m)
        A005811(binomial(n,m)) ;
    end proc: # R. J. Mathar, Mar 10 2015
  • Mathematica
    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[Binomial[n, m]]], {m, 0, n}], {n, 0, 10}];
    Flatten[%]

Formula

T(n,m) = A005811(binomial(n,m)), 0<=m<=n.

Extensions

Edited by R. J. Mathar, Mar 10 2015