login
The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A143214 Gray code applied to Pascal's triangle: T(n,m)=GrayCode(binomial(n,m)). 4
1, 1, 1, 1, 3, 1, 1, 2, 2, 1, 1, 6, 5, 6, 1, 1, 7, 15, 15, 7, 1, 1, 5, 8, 30, 8, 5, 1, 1, 4, 31, 50, 50, 31, 4, 1, 1, 12, 18, 36, 101, 36, 18, 12, 1, 1, 13, 54, 126, 65, 65, 126, 54, 13, 1, 1, 15, 59, 68, 187, 130, 187, 68, 59, 15, 1 (list; table; graph; refs; listen; history; text; internal format)
OFFSET

1,5

COMMENTS

Row sums are 1, 2, 5, 6, 19, 46, 58, 172, 235, 518, 790, ... .

LINKS

Table of n, a(n) for n=1..66.

Eric Weisstein, Mathematica Notebook GrayCode.nb

Eric Weisstein, Gray Code, MathWorld.

FORMULA

T(n,m) = A003188(binomial(n,m)).

EXAMPLE

1;

1, 1;

1, 3, 1;

1, 2, 2, 1;

1, 6, 5, 6, 1;

1, 7, 15, 15, 7, 1;

1, 5, 8, 30, 8, 5, 1;

1, 4, 31, 50, 50, 31, 4, 1;

1, 12, 18, 36, 101, 36, 18, 12, 1;

1, 13, 54, 126, 65, 65, 126, 54, 13, 1;

1, 15, 59, 68, 187, 130, 187, 68, 59, 15, 1;

MAPLE

A143214 := proc(n, m)

    A003188(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 ]; 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]; a = Table[Table[Binomial[n, m], {m, 0, n}], {n, 0, 10}] b=Table[Flatten[Table[GrayCode[a[[n]][[m]], 10], {m, 1, n}]], {n, 1, Length[ a]}]; Flatten[%]

(* program for a fractal picture modulo two: *)

c = Table[Table[If[m <= n, Mod[b[[n]][[m]], 2], 0], {m, 1, Length[b]}], {n, 1, Length[b]}]; ListDensityPlot[c, Mesh -> False]

(* The fractal pattern is the same for Pascal's triangle and the MacMahon numbers, A060187, but not for Eulerian numbers, A123125.*)

CROSSREFS

Cf. A123125, A060187.

Sequence in context: A176346 A073166 A050169 * A300380 A300682 A300605

Adjacent sequences:  A143211 A143212 A143213 * A143215 A143216 A143217

KEYWORD

nonn,tabl

AUTHOR

Roger L. Bagula and Gary W. Adamson, Oct 20 2008

EXTENSIONS

Edited by Michel Marcus and Joerg Arndt, Apr 22 2013

STATUS

approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified January 24 07:18 EST 2020. Contains 331189 sequences. (Running on oeis4.)