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


S := proc(n)
    local i, j, values, position;
    values := [ seq(" ",i=1..2^n-1), "*" ];
    printf("%s\n",cat(op(values)));
    for i from 2 to 2^n do
        position := [ ListTools:-SearchAll( "*", values ) ];
        values := Array([ seq(0, i=1..2^n+i-1) ]);
        for j to numelems(position) do
            values[position[j]-1] := values[position[j]-1] + 1;
            values[position[j]+1] := values[position[j]+1] + 1;
        end do;
        values := subs( { 2 = " ", 0 = " ", 1 = "*"}, values );  
        printf("%s\n",cat(op(convert(values, list))));
    end do:
end proc: