Two park rangers at a Civil War
battle site are assigned the job of
counting a pile of cannonballs
arranged in the shape of a regular
tetrahedron. The first ranger says,
“We will have to disassemble the
pile to count the cannonballs in the
middle.”
The second ranger replies, “That won’t be necessary. Just tell me the number n of balls along one side of the bottom layer, and I can calculate the total number in the stack.”
What closed-form formula did he use?
Wikipedia gives the formula for the nth tetrahedral number as
C(n+2,3)
which is (n+2)! / (6*(n-1)!)
showing first 12 below, calculated both ways:
>> for n=1:12 disp([n nchoosek(n+2,3)])
end
1 1
2 4
3 10
4 20
5 35
6 56
7 84
8 120
9 165
10 220
11 286
12 364
>> for n=1:12 disp([n factorial(n+2) / (6*factorial(n-1))])
end
1 1
2 4
3 10
4 20
5 35
6 56
7 84
8 120
9 165
10 220
11 286
12 364
>>
|
Posted by Charlie
on 2025-02-12 09:31:14 |