Task
Produce an ASCII representation of a Sierpinski triangle of order   N.



Example
The Sierpinski triangle of order   4   should look like this:

                       *
                      * *
                     *   *
                    * * * *
                   *       *
                  * *     * *
                 *   *   *   *
                * * * * * * * *
               *               *
              * *             * *
             *   *           *   *
            * * * *         * * * *
           *       *       *       *
          * *     * *     * *     * *
         *   *   *   *   *   *   *   *
        * * * * * * * * * * * * * * * *



Related tasks
 Sierpinski triangle/Graphical for graphics images of this pattern. 
 Sierpinski carpet


sierpinskiTriangle
=LAMBDA(c,
    LAMBDA(n,
        IF(0 = n,
            c,
            LET(
                prev, sierpinskiTriangle(c)(n - 1),
 
                APPENDROWS(
                    sierpCentered(prev)
                )(
                    sierpDoubled(prev)
                )
            )
        )
    )
)
 
 
sierpCentered
=LAMBDA(grid,
    LET(
        nRows, ROWS(grid),
        padding, IF(
            SEQUENCE(nRows, nRows, 1, 1),
            " "
        ),
 
        APPENDCOLS(
            APPENDCOLS(padding)(grid)
        )(padding)
    )
)
 
 
sierpDoubled
=LAMBDA(grid,
    APPENDCOLS(
        APPENDCOLS(grid)(
            IF(SEQUENCE(ROWS(grid), 1, 1, 1),
                " "
            )
        )
    )(grid)
)