Three or four.
Let us use three-sided pyramids (sometimes called tetrahedrons). To make the pyramid, start with a triangular arrangement of tennis balls for the bottom layer. Next stack up tennis balls layer at a time, as at right.
If the base of the pyramid has 5 balls along a side, how many balls does the entire pyramid have in it? Let us call this a pyramidal number.
Here is a chart that shows the number of balls in the side of a base, N, and the corresponding pyramidal numbers.
The picture starts with the base of the pyramid for Pyramid(5). Click a few times to see the complete pyramid. Smaller pyramids can be found within this one. (For example, the top two layers can be considered a pyramid that has a base with two balls on a side.) For small pyramids, count the balls within them. For larger pyramids, try to find a clever way to calculate the number of balls they contain.
Click on the image a few times and fill in some of the chart.