Task
Produce a graphical or ASCII-art representation of a Sierpinski carpet of order   N.



For example, the Sierpinski carpet of order   3   should look like this:

###########################
# ## ## ## ## ## ## ## ## #
###########################
###   ######   ######   ###
# #   # ## #   # ## #   # #
###   ######   ######   ###
###########################
# ## ## ## ## ## ## ## ## #
###########################
#########         #########
# ## ## #         # ## ## #
#########         #########
###   ###         ###   ###
# #   # #         # #   # #
###   ###         ###   ###
#########         #########
# ## ## #         # ## ## #
#########         #########
###########################
# ## ## ## ## ## ## ## ## #
###########################
###   ######   ######   ###
# #   # ## #   # ## #   # #
###   ######   ######   ###
###########################
# ## ## ## ## ## ## ## ## #
###########################

The use of the   #   character is not rigidly required for ASCII art.

The important requirement is the placement of whitespace and non-whitespace characters.



Related task

   Sierpinski triangle


 100 HGR
 110 POKE 49234,0
 120 DEF  FN M(X) = X -  INT (D * 3) *  INT (X /  INT (D * 3))
 130 DE = 4
 140 DI = 3 ^ DE * 3
 150 FOR I = 0 TO DI - 1
 160      FOR J = 0 TO DI - 1
 170          FOR D = DI / 3 TO 0 STEP 0
 180              IF  INT ( FN M(I) / D) = 1 AND  INT ( FN M(J) / D) = 1 THEN 200BREAK
 190              D =  INT (D / 3): NEXT D
 200          HCOLOR= 3 * (D = 0)
 210          HPLOT J,I
 220      NEXT J
 230 NEXT I