|
|
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
|
|
|
FORMULA
|
|
|
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
|
|
|
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
|
|
|
KEYWORD
|
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|