The first layer has 1 cubes.
There are four cubes on the second floor.
The third layer has 10 cubes.
The difference between the first floor and the second floor is 4- 1=3.
The difference between the second floor and the third floor is 10-4=6.
The difference between the fourth floor and the third floor is 9.
Check the fifth and fourth floors 12.
So the difference between each floor is a arithmetic progression.
The fifth floor should be10+9+12 = 31.
Decision theorem
1: A diamond with equal diagonal lines is a square.
2. Diamonds with right angles are squares.
3: Rectangles with diagonal lines perpendicular to each other are squares.
4. A set of rectangles with equal adjacent sides is a square.
5. A set of parallelograms with equal adjacent sides and one angle at right angles is a square.