3 added 19 characters in body edited Oct 1 '17 at 11:45 kglr 222k1010 gold badges253253 silver badges511511 bronze badges Also: ClearAll[toLTM] toLTM[n_Integer] := Composition[Transpose, PadLeft, Range, Reverse, Range]@n (* or toLTM[n_Integer] := Reverse /@ PadLeft @ Range @ Range @ n *) toLTM[v_List] := ReverseTranspose /@ PadLeft @ Extract[v, List /@ Range @ Reverse @ Range @ Length @ v] toLTM @ 4 // TeXForm  $$\left( \begin{array}{cccc} 1 & 0 & 0 & 0 \\ 2 & 1 & 0 & 0 \\ 3 & 2 & 1 & 0 \\ 4 & 3 & 2 & 1 \\ \end{array} \right)$$ toLTM @ CharacterRange["a", "d"] // TeXForm  $$\left( \begin{array}{cccc} \text{a} & 0 & 0 & 0 \\ \text{b} & \text{a} & 0 & 0 \\ \text{c} & \text{b} & \text{a} & 0 \\ \text{d} & \text{c} & \text{b} & \text{a} \\ \end{array} \right)$$ Also: ClearAll[toLTM] toLTM[n_Integer] := Composition[Transpose, PadLeft, Range, Reverse, Range]@n (* or toLTM[n_Integer] := Reverse /@ PadLeft @ Range @ Range @ n *) toLTM[v_List] := Reverse /@ PadLeft @ Extract[v, List /@ Range @ Range @ Length @ v] toLTM @ 4 // TeXForm  $$\left( \begin{array}{cccc} 1 & 0 & 0 & 0 \\ 2 & 1 & 0 & 0 \\ 3 & 2 & 1 & 0 \\ 4 & 3 & 2 & 1 \\ \end{array} \right)$$ toLTM @ CharacterRange["a", "d"] // TeXForm  $$\left( \begin{array}{cccc} \text{a} & 0 & 0 & 0 \\ \text{b} & \text{a} & 0 & 0 \\ \text{c} & \text{b} & \text{a} & 0 \\ \text{d} & \text{c} & \text{b} & \text{a} \\ \end{array} \right)$$ Also: ClearAll[toLTM] toLTM[n_Integer] := Composition[Transpose, PadLeft, Range, Reverse, Range]@n (* or toLTM[n_Integer] := Reverse /@ PadLeft @ Range @ Range @ n *) toLTM[v_List] := Transpose @ PadLeft @ Extract[v, List /@ Range @ Reverse @ Range @ Length @ v] toLTM @ 4 // TeXForm  $$\left( \begin{array}{cccc} 1 & 0 & 0 & 0 \\ 2 & 1 & 0 & 0 \\ 3 & 2 & 1 & 0 \\ 4 & 3 & 2 & 1 \\ \end{array} \right)$$ toLTM @ CharacterRange["a", "d"] // TeXForm  $$\left( \begin{array}{cccc} \text{a} & 0 & 0 & 0 \\ \text{b} & \text{a} & 0 & 0 \\ \text{c} & \text{b} & \text{a} & 0 \\ \text{d} & \text{c} & \text{b} & \text{a} \\ \end{array} \right)$$ 2 added 96 characters in body edited Oct 1 '17 at 11:37 kglr 222k1010 gold badges253253 silver badges511511 bronze badges Also: ClearAll[toLTM] toLTM[n_Integer] := Composition[Transpose, PadLeft, Range, Reverse, Range]@n (* or toLTM[n_Integer] := Reverse /@ PadLeft[Range[Range@n]]PadLeft @ Range @ Range @ n *) toLTM[v_List] := Reverse /@ PadLeft[Extract[vPadLeft @ Extract[v, List /@ Range[Range@Length@v]]]Range @ Range @ Length @ v] toLTM @ 4 // TeXForm  $$\left( \begin{array}{cccc} 1 & 0 & 0 & 0 \\ 2 & 1 & 0 & 0 \\ 3 & 2 & 1 & 0 \\ 4 & 3 & 2 & 1 \\ \end{array} \right)$$ toLTM @ CharacterRange["a", "d"] // TeXForm  $$\left( \begin{array}{cccc} \text{a} & 0 & 0 & 0 \\ \text{b} & \text{a} & 0 & 0 \\ \text{c} & \text{b} & \text{a} & 0 \\ \text{d} & \text{c} & \text{b} & \text{a} \\ \end{array} \right)$$ Also: ClearAll[toLTM] toLTM[n_Integer] := Reverse /@ PadLeft[Range[Range@n]] toLTM[v_List] := Reverse /@ PadLeft[Extract[v, List /@ Range[Range@Length@v]]] toLTM @ 4 // TeXForm  $$\left( \begin{array}{cccc} 1 & 0 & 0 & 0 \\ 2 & 1 & 0 & 0 \\ 3 & 2 & 1 & 0 \\ 4 & 3 & 2 & 1 \\ \end{array} \right)$$ toLTM @ CharacterRange["a", "d"] // TeXForm  $$\left( \begin{array}{cccc} \text{a} & 0 & 0 & 0 \\ \text{b} & \text{a} & 0 & 0 \\ \text{c} & \text{b} & \text{a} & 0 \\ \text{d} & \text{c} & \text{b} & \text{a} \\ \end{array} \right)$$ Also: ClearAll[toLTM] toLTM[n_Integer] := Composition[Transpose, PadLeft, Range, Reverse, Range]@n (* or toLTM[n_Integer] := Reverse /@ PadLeft @ Range @ Range @ n *) toLTM[v_List] := Reverse /@ PadLeft @ Extract[v, List /@ Range @ Range @ Length @ v] toLTM @ 4 // TeXForm  $$\left( \begin{array}{cccc} 1 & 0 & 0 & 0 \\ 2 & 1 & 0 & 0 \\ 3 & 2 & 1 & 0 \\ 4 & 3 & 2 & 1 \\ \end{array} \right)$$ toLTM @ CharacterRange["a", "d"] // TeXForm  $$\left( \begin{array}{cccc} \text{a} & 0 & 0 & 0 \\ \text{b} & \text{a} & 0 & 0 \\ \text{c} & \text{b} & \text{a} & 0 \\ \text{d} & \text{c} & \text{b} & \text{a} \\ \end{array} \right)$$ 1 answered Oct 1 '17 at 11:31 kglr 222k1010 gold badges253253 silver badges511511 bronze badges Also: ClearAll[toLTM] toLTM[n_Integer] := Reverse /@ PadLeft[Range[Range@n]] toLTM[v_List] := Reverse /@ PadLeft[Extract[v, List /@ Range[Range@Length@v]]] toLTM @ 4 // TeXForm  $$\left( \begin{array}{cccc} 1 & 0 & 0 & 0 \\ 2 & 1 & 0 & 0 \\ 3 & 2 & 1 & 0 \\ 4 & 3 & 2 & 1 \\ \end{array} \right)$$ toLTM @ CharacterRange["a", "d"] // TeXForm  $$\left( \begin{array}{cccc} \text{a} & 0 & 0 & 0 \\ \text{b} & \text{a} & 0 & 0 \\ \text{c} & \text{b} & \text{a} & 0 \\ \text{d} & \text{c} & \text{b} & \text{a} \\ \end{array} \right)$$