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


 
#lang racket
(define (sierpinski n)
  (if (zero? n)
    '("*")
    (let ([spaces (make-string (expt 2 (sub1 n)) #\space)]
          [prev   (sierpinski (sub1 n))])
      (append (map (λ(x) (~a spaces x spaces)) prev)
              (map (λ(x) (~a x " " x)) prev)))))
(for-each displayln (sierpinski 5))
 