In the Star Trek episode "The Trouble with Tribbles," when Kirk opens the door and all the tribbles fall on him, Spock says that there are 1,771,561 tribbles in the wheat compartment, basing that calculation on one tribble entering 3 days ago, producing an average litter of 10 every 12 hours (and also factors in space and amount of wheat).
Is this based on any math or has David Gerrold ever said he did any math on this?
I started playing around and found the first litter, in 12 hours, would be 10 tribbles, and 10 tribbles having another litter in 12 hours would mean an additional 100, then an additional 1,000 12 hours later.
Then I realized I was leaving out the existing tribbles when counting each generation and tried to keep track in different columns, but made some place value mistakes. Still, it looked like that number, which I thought absurd at first, might be reasonable.
Has anyone ever done the actual math on this to see if 1,771,561 tribbles is reasonable under the circumstances?