GraphicsGrid[Partition[Table[
Graphics[Table[
x=Sum[a[[i]](3^(-i)),{i,n}]; y=Sum[b[[i]](3^(-i)),{i,n}];
Rectangle[{x,y},{x,y}+(3^(-n))],
{a,Tuples[{0,2},n]}, {b,Tuples[{0,2},n]}]],
{n,0,5}],3],Frame->All]