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.