Skip to main content
Commonmark migration
Source Link

#Mathematica 83 49 43 54 51

Mathematica 83 49 43 54 51

Print@@#&/@(Sum[k~DiamondMatrix~17,{k,0,8}]/.0->" ")

formatting improved


With 3 bytes saved thanks to Kelly Lowder.

Analysis

The principal part of the code, Sum[DiamondMatrix[k, 17], {k, 0, 8}], can be checked on WolframAlpha.

The following shows the underlying logic of the approach, on a smaller scale.

a = 0~DiamondMatrix~5;
b = 1~DiamondMatrix~5;
c = 2~DiamondMatrix~5;
d = a + b + c;
e = d /. 0 -> "";
Grid /@ {a, b, c, d, e}

grids

#Mathematica 83 49 43 54 51

Print@@#&/@(Sum[k~DiamondMatrix~17,{k,0,8}]/.0->" ")

formatting improved


With 3 bytes saved thanks to Kelly Lowder.

Analysis

The principal part of the code, Sum[DiamondMatrix[k, 17], {k, 0, 8}], can be checked on WolframAlpha.

The following shows the underlying logic of the approach, on a smaller scale.

a = 0~DiamondMatrix~5;
b = 1~DiamondMatrix~5;
c = 2~DiamondMatrix~5;
d = a + b + c;
e = d /. 0 -> "";
Grid /@ {a, b, c, d, e}

grids

Mathematica 83 49 43 54 51

Print@@#&/@(Sum[k~DiamondMatrix~17,{k,0,8}]/.0->" ")

formatting improved


With 3 bytes saved thanks to Kelly Lowder.

Analysis

The principal part of the code, Sum[DiamondMatrix[k, 17], {k, 0, 8}], can be checked on WolframAlpha.

The following shows the underlying logic of the approach, on a smaller scale.

a = 0~DiamondMatrix~5;
b = 1~DiamondMatrix~5;
c = 2~DiamondMatrix~5;
d = a + b + c;
e = d /. 0 -> "";
Grid /@ {a, b, c, d, e}

grids

added 35 characters in body
Source Link
DavidC
  • 25.5k
  • 2
  • 53
  • 106

#Mathematica 83 49 43 54 5451

Grid[Sum[k~DiamondMatrix~17Print@@#&/@(Sum[k~DiamondMatrix~17, {k, 0, 8}] /. 0 -> "", Spacings ->>" 0]")

formatting improved


With 3 bytes saved thanks to Kelly Lowder.

Analysis

The principal part of the code, Sum[DiamondMatrix[k, 17], {k, 0, 8}], can be checked on WolframAlpha.

The following shows the underlying logic of the approach, on a smaller scale.

a = 0~DiamondMatrix~5;
b = 1~DiamondMatrix~5;
c = 2~DiamondMatrix~5;
d = a + b + c;
e = d /. 0 -> "";
Grid /@ {a, b, c, d, e}

grids

#Mathematica 83 49 43 54

Grid[Sum[k~DiamondMatrix~17, {k, 0, 8}] /. 0 -> "", Spacings -> 0]

formatting improved


Analysis

The principal part of the code, Sum[DiamondMatrix[k, 17], {k, 0, 8}], can be checked on WolframAlpha.

The following shows the underlying logic of the approach, on a smaller scale.

a = 0~DiamondMatrix~5;
b = 1~DiamondMatrix~5;
c = 2~DiamondMatrix~5;
d = a + b + c;
e = d /. 0 -> "";
Grid /@ {a, b, c, d, e}

grids

#Mathematica 83 49 43 54 51

Print@@#&/@(Sum[k~DiamondMatrix~17,{k,0,8}]/.0->" ")

formatting improved


With 3 bytes saved thanks to Kelly Lowder.

Analysis

The principal part of the code, Sum[DiamondMatrix[k, 17], {k, 0, 8}], can be checked on WolframAlpha.

The following shows the underlying logic of the approach, on a smaller scale.

a = 0~DiamondMatrix~5;
b = 1~DiamondMatrix~5;
c = 2~DiamondMatrix~5;
d = a + b + c;
e = d /. 0 -> "";
Grid /@ {a, b, c, d, e}

grids

edited body
Source Link
Timwi
  • 13k
  • 3
  • 46
  • 66

#Mathematica 83 49 43 54

Grid[Sum[k~DiamondMatrix~17, {k, 0, 8}] /. 0 -> "", Spacings -> 0]

formatting improved


Analysis

The principleprincipal part of the code, Sum[DiamondMatrix[k, 17], {k, 0, 8}], can be checked on WolframAlpha.

The following shows the underlying logic of the approach, on a smaller scale.

a = 0~DiamondMatrix~5;
b = 1~DiamondMatrix~5;
c = 2~DiamondMatrix~5;
d = a + b + c;
e = d /. 0 -> "";
Grid /@ {a, b, c, d, e}

grids

#Mathematica 83 49 43 54

Grid[Sum[k~DiamondMatrix~17, {k, 0, 8}] /. 0 -> "", Spacings -> 0]

formatting improved


Analysis

The principle part of the code, Sum[DiamondMatrix[k, 17], {k, 0, 8}], can be checked on WolframAlpha.

The following shows the underlying logic of the approach, on a smaller scale.

a = 0~DiamondMatrix~5;
b = 1~DiamondMatrix~5;
c = 2~DiamondMatrix~5;
d = a + b + c;
e = d /. 0 -> "";
Grid /@ {a, b, c, d, e}

grids

#Mathematica 83 49 43 54

Grid[Sum[k~DiamondMatrix~17, {k, 0, 8}] /. 0 -> "", Spacings -> 0]

formatting improved


Analysis

The principal part of the code, Sum[DiamondMatrix[k, 17], {k, 0, 8}], can be checked on WolframAlpha.

The following shows the underlying logic of the approach, on a smaller scale.

a = 0~DiamondMatrix~5;
b = 1~DiamondMatrix~5;
c = 2~DiamondMatrix~5;
d = a + b + c;
e = d /. 0 -> "";
Grid /@ {a, b, c, d, e}

grids

formatting improved to match example of OP.
Source Link
DavidC
  • 25.5k
  • 2
  • 53
  • 106
Loading
wolfram alpha link added
Source Link
DavidC
  • 25.5k
  • 2
  • 53
  • 106
Loading
added 22 characters in body
Source Link
DavidC
  • 25.5k
  • 2
  • 53
  • 106
Loading
analysis added
Source Link
DavidC
  • 25.5k
  • 2
  • 53
  • 106
Loading
analysis added
Source Link
DavidC
  • 25.5k
  • 2
  • 53
  • 106
Loading
deleted 10 characters in body
Source Link
DavidC
  • 25.5k
  • 2
  • 53
  • 106
Loading
image replaced
Source Link
DavidC
  • 25.5k
  • 2
  • 53
  • 106
Loading
better exploitation of DiamondMatrix
Source Link
DavidC
  • 25.5k
  • 2
  • 53
  • 106
Loading
Source Link
DavidC
  • 25.5k
  • 2
  • 53
  • 106
Loading