Generate Pascal's Pyramid Pascal's Pyramid is an extension of Pascal's Triangle to the third dimension. Starting with a 1 as the apex, the elements of each successive layer can be determined by summing the three numbers that are above it. The nth layer contains the coefficients of (a + b + c)^(n-1).

You are to create a program that, given an input n, outputs the first n layers of Pascal's Pyramid. There must be two newlines between the different layers, and they must be in order. Within each layer, each row must be on a separate line, with the elements separated by spaces. Apart from that, you may format the pyramid however you like.

Your code should be reasonably fast generating a pyramid with 10 layers.

For example, your program, when given 4 as input, should output something like this:

1

1
1 1

1
2 2
1 2 1

1
3 3
3 6 3
1 3 3 1


May the shortest code win!
Python, 110

l=1
exec"print;n=1;r=0;exec\"c=0;exec'print n,;n*=r-c;c+=1;n/=c;'*r;print n;r+=1;n=n*l/r-n;\"*l;l+=1;"*input()


Original, ungolfed solution:

for layer in range(1, input() + 1):
    print
    n = 1
    for row in range(1, layer + 1):
        for col in range(1, row):
            print n,
            n *= row - col
            n /= col
        print n
        n *= layer - row
        n /= row