In this scene from that episode, Spock says that there are 1,771,561 tribbles onboard the Enterprise.
How does he come up with that figure? Kyle Hill, a science journalist, derived Spock's mathematical calculations
Above, I started with what I knew. For P (population) at time 0 (when the tribbles first came aboard), there was 1 tribble. Easy enough. We also knew, thanks to Spock, that after 72 hours, P was equal to 1,771,561. Now it gets a little more complicated.
To write a useful equation, what we really want to know is what the population of tribbles will be at any one time. Therefore, I wrote Population=P(t). But we know that tribbles grow exponentially (or we are checking that assumption), so we have to include that information. To find the rate of tribble growth, we take the mathematical derivative of Population=P(t) to get P’(t). Putting those two together we get P’(t)=kP(t). (This equation says that the rate of growth is equal to some constant k times the population at some time. K pops out of the normal process of taking the derivative of a function.)