Return to Answer

 2 deleted 97 characters in body edited Oct 28 '14 at 16:30 Junho Lee 4,65511 gold badge1111 silver badges3030 bronze badges k[] is function defined by you and tri is making UndirectedEdge-s k[j_List] := Block[{t = j[[1]], r = j[[2]], i = j[[3]]}, (2 t - 1) 2^(-i + r) 3^(-1 + i)] tri[{t_, r_, i_}] := { {t, r, i} <-> {t, r + 1, i}, {t, r + 1, i} <-> {t, r + 1, i + 1}, {t, r + 1, i + 1} <-> {t, r, i} }  I remaked your code like this for making Graph. d = 4; data = Flatten@Table[tri[{1, i, j}], {i, 1, d - 1}, {j, 1, i}]; data2 = Apply[k[{##}] &, data, {2}]; vert = (VertexList@Graph@data)[[All, 2 ;; 3]]; co = Composition[ RotationTransform[-\[Pi]/3], ShearingTransform[\[Pi]/6, {-1, 0}, {0, 1}], ScalingTransform[Sqrt[3]/2, {0, 1}]] /@ vert; Graph[data2, VertexLabels -> "Name", VertexCoordinates -> co ]co]  and I make number lines by following code, this is my guess you wanted. l1 = k /@ VertexList@Graph@data; l2 = Transpose@{l1, co}; l3 = Sort[l2, #1[[2, 1]] > #2[[2, 1]] && #1[[2, 2]] > #2[[2, 2]] &]; Reverse@(Transpose@l3)[[1]]  {1, 2, 3, 4, 6, 8, 9, 12, 18, 27} PathGraph[Reverse@(Transpose@l3)[[1]],   VertexLabels -> "Name", GraphLayout -> Automatic]"Name"]  9-row triangle and this is number line of 9-row triangle k[] is function defined by you and tri is making UndirectedEdge-s k[j_List] := Block[{t = j[[1]], r = j[[2]], i = j[[3]]}, (2 t - 1) 2^(-i + r) 3^(-1 + i)] tri[{t_, r_, i_}] := { {t, r, i} <-> {t, r + 1, i}, {t, r + 1, i} <-> {t, r + 1, i + 1}, {t, r + 1, i + 1} <-> {t, r, i} }  I remaked your code like this for making Graph. d = 4; data = Flatten@Table[tri[{1, i, j}], {i, 1, d - 1}, {j, 1, i}]; data2 = Apply[k[{##}] &, data, {2}]; vert = (VertexList@Graph@data)[[All, 2 ;; 3]]; co = Composition[ RotationTransform[-\[Pi]/3], ShearingTransform[\[Pi]/6, {-1, 0}, {0, 1}], ScalingTransform[Sqrt[3]/2, {0, 1}]] /@ vert; Graph[data2, VertexLabels -> "Name", VertexCoordinates -> co ]  and I make number lines by following code, this is my guess you wanted. l1 = k /@ VertexList@Graph@data; l2 = Transpose@{l1, co}; l3 = Sort[l2, #1[[2, 1]] > #2[[2, 1]] && #1[[2, 2]] > #2[[2, 2]] &]; Reverse@(Transpose@l3)[[1]]  {1, 2, 3, 4, 6, 8, 9, 12, 18, 27} PathGraph[Reverse@(Transpose@l3)[[1]],   VertexLabels -> "Name", GraphLayout -> Automatic]  9-row triangle and this is number line of 9-row triangle k[] is function defined by you and tri is making UndirectedEdge-s k[j_List] := Block[{t = j[[1]], r = j[[2]], i = j[[3]]},(2 t - 1) 2^(-i + r) 3^(-1 + i)] tri[{t_, r_, i_}] := {{t, r, i} <-> {t, r + 1, i}, {t, r + 1, i} <-> {t, r + 1, i + 1},{t, r + 1, i + 1} <-> {t, r, i}}  I remaked your code like this for making Graph. d = 4; data = Flatten@Table[tri[{1, i, j}],{i, 1, d - 1}, {j, 1, i}]; data2 = Apply[k[{##}] &, data, {2}]; vert = (VertexList@Graph@data)[[All, 2 ;; 3]]; co = Composition[ RotationTransform[-\[Pi]/3], ShearingTransform[\[Pi]/6, {-1, 0}, {0, 1}], ScalingTransform[Sqrt[3]/2, {0, 1}]] /@ vert; Graph[data2,VertexLabels -> "Name",VertexCoordinates -> co]  and I make number lines by following code, this is my guess you wanted. l1 = k /@ VertexList@Graph@data; l2 = Transpose@{l1, co}; l3 = Sort[l2, #1[[2, 1]] > #2[[2, 1]] && #1[[2, 2]] > #2[[2, 2]] &]; Reverse@(Transpose@l3)[[1]]  {1, 2, 3, 4, 6, 8, 9, 12, 18, 27} PathGraph[Reverse@(Transpose@l3)[[1]], VertexLabels -> "Name"]  9-row triangle 1 answered Oct 28 '14 at 16:25 Junho Lee 4,65511 gold badge1111 silver badges3030 bronze badges k[] is function defined by you and tri is making UndirectedEdge-s k[j_List] := Block[{t = j[[1]], r = j[[2]], i = j[[3]]}, (2 t - 1) 2^(-i + r) 3^(-1 + i)] tri[{t_, r_, i_}] := { {t, r, i} <-> {t, r + 1, i}, {t, r + 1, i} <-> {t, r + 1, i + 1}, {t, r + 1, i + 1} <-> {t, r, i} }  I remaked your code like this for making Graph. d = 4; data = Flatten@Table[tri[{1, i, j}], {i, 1, d - 1}, {j, 1, i}]; data2 = Apply[k[{##}] &, data, {2}]; vert = (VertexList@Graph@data)[[All, 2 ;; 3]]; co = Composition[ RotationTransform[-\[Pi]/3], ShearingTransform[\[Pi]/6, {-1, 0}, {0, 1}], ScalingTransform[Sqrt[3]/2, {0, 1}]] /@ vert; Graph[data2, VertexLabels -> "Name", VertexCoordinates -> co ]  and I make number lines by following code, this is my guess you wanted. l1 = k /@ VertexList@Graph@data; l2 = Transpose@{l1, co}; l3 = Sort[l2, #1[[2, 1]] > #2[[2, 1]] && #1[[2, 2]] > #2[[2, 2]] &]; Reverse@(Transpose@l3)[[1]]  {1, 2, 3, 4, 6, 8, 9, 12, 18, 27} PathGraph[Reverse@(Transpose@l3)[[1]], VertexLabels -> "Name", GraphLayout -> Automatic]  9-row triangle and this is number line of 9-row triangle