650 cannonballs
Explanation step by step:
upper layer = 1 ^ 2
second layer = 2 ^ 2
third layer = 3 ^ 2
layer 12 is 12 ^ 2
The formula is:
n * (n + 1) * (2n + 1) / 6
n = 12
12 (12 + 1) (2 * 12 + 1) / 6
12 * 13 * 25/6 =
650
There are 650 cannonballs in this pyramid.