The triangular base of the pyramid contains 10 balls in an equilateral arrangement: start with 4 balls in a line, ABCD, then a line of 3 balls so that ball E touches A and B, ball F touches B and C, and ball G touches C and D; then a pair of balls H and I similarly touching E, F and G; and a single ball touching both H and I. That's the base. The next level contains 6 balls. It's like the base but starts with 3 balls in a line instead of 4. The third level has only 3 balls and the top level has a single ball sitting in the middle of the 3 balls making up the third level. The number of balls used is 10+6+3+1=20 in 4 layers or levels. To keep the balls in the base from sliding apart, a triangle, such as the one used in snooker or pool, is needed as an enclosure.