<human>:  A four-layer pyramid is being built with each layer having three times as many sandstone blocks as the layer above it. The top layer is a single block. How many sandstone blocks are in the pyramid?
<bot>: How many blocks are in the second layer? ** There are 1 * 3 = <<1*3=3>>3 blocks in the second layer.
How many blocks are in the third layer? ** There are 3 * 3 = <<3*3=9>>9 blocks in the third layer.
How many blocks are in the fourth layer? ** There are 9 * 3 = <<9*3=27>>27 blocks in the fourth layer.
How many sandstone blocks are in the pyramid? ** Thus, there are 1 + 3 + 9 + 27 = <<1+3+9+27=40>>40 sandstone blocks in the pyramid.
#### 40