Floyd's triangle   lists the natural numbers in a right triangle aligned to the left where

 the first row is   1     (unity)
 successive rows start towards the left with the next number followed by successive naturals listing one more number than the line above.


The first few lines of a Floyd triangle looks like this:

 1
 2  3
 4  5  6
 7  8  9 10
11 12 13 14 15



Task

 Write a program to generate and display here the first   n   lines of a Floyd triangle. 
(Use   n=5   and   n=14   rows).
 Ensure that when displayed in a mono-space font, the numbers line up in vertical columns as shown and that only one space separates numbers of the last row.


# floyd(n) creates an n-row floyd's triangle
def floyd(n):
  def lpad(len): tostring | (((len - length) * " ")  + .);
 
  # Construct an array of widths.
  # Assuming N is the last integer on the last row (i.e. (n+1)*n/2),
  # the last row has n entries from (1+N-n) through N:
  def widths:
    ((n+1)*n/2) as $N
    | [range(1 + $N - n; $N + 1) | tostring | length];
 
  # emit line k assuming it starts with the integer "start"
  def line(start; k; widths):
    reduce range(start; start+k) as $i
      (""; . + ($i|lpad(widths[$i - start])) + " ");
 
  widths as $widths
  | (reduce range(0;n) as $row
      ( [0, ""];   # state: i, string
        (.[0] + 1) as $i | .[1] as $string
        | [ ($i + $row),
            ($string + "\n" + line($i; $row + 1; $widths )) ] )
    | .[1] ) ;