login

Revision History for A143214

(Bold, blue-underlined text is an addition; faded, red-underlined text is a deletion.)

Showing entries 1-10 | older changes
Gray code applied to Pascal's triangle: T(n,k) = GrayCode(binomial(n, k)).
(history; published version)
#20 by OEIS Server at Tue Aug 27 04:28:03 EDT 2024
LINKS

G. C. Greubel, <a href="/A143214/b143214_1.txt">Rows n = 1..50 of the triangle, flattened</a>

#19 by Joerg Arndt at Tue Aug 27 04:28:03 EDT 2024
STATUS

reviewed

approved

Discussion
Tue Aug 27
04:28
OEIS Server: Installed first b-file as b143214.txt.
#18 by Michel Marcus at Tue Aug 27 04:16:38 EDT 2024
STATUS

proposed

reviewed

#17 by G. C. Greubel at Tue Aug 27 04:09:45 EDT 2024
STATUS

editing

proposed

#16 by G. C. Greubel at Tue Aug 27 04:09:37 EDT 2024
LINKS

G. C. Greubel, <a href="/A143214/b143214_1.txt">Rows n = 1..50 of the triangle, flattened</a>

EXTENSIONS

Edited by G. C. Greubel, Aug 27 2024

#15 by G. C. Greubel at Tue Aug 27 01:39:39 EDT 2024
NAME

Gray code applied to Pascal's triangle: T(n,mk) = GrayCode(binomial(n,m k)).

COMMENTS

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

FORMULA

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

EXAMPLE

Triangle begins as:

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.*)

GrayCode[n_, k_]:= FromDigits[BitXor@@@Partition[Prepend[IntegerDigits[n, 2, k], 0], 2, 1], 2];

A143214[n_, k_]:= GrayCode[Binomial[n-1, k-1], 10];

Table[A143214[n, k], {n, 12}, {k, n}]//Flatten

CROSSREFS
STATUS

approved

editing

Discussion
Tue Aug 27
01:47
G. C. Greubel: The first Mma program included segments not needed (full copy of the MathWorld Mma work sheet). It has been reduced to only the necessary components.  This sequence had the same problem as A143213. The GrayCode[n, 10] (or GrayCode[n,n]) and sequence A003188(n) agree to (about) terms 1090 before they differ. This means that any value of binomial(n,k) > 1100 has one value for A003188(1100+) and another (often smaller) value for GrayCode[1100+, 10]. Due to this any relation to A003188 has been removed.
#14 by Jon E. Schoenfield at Sun Oct 04 01:51:18 EDT 2015
STATUS

editing

approved

#13 by Jon E. Schoenfield at Sun Oct 04 01:51:15 EDT 2015
COMMENTS

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

STATUS

approved

editing

#12 by R. J. Mathar at Tue Mar 10 05:41:40 EDT 2015
STATUS

editing

approved

#11 by R. J. Mathar at Tue Mar 10 05:40:56 EDT 2015
FORMULA

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

EXAMPLE

{1},

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

STATUS

approved

editing