(Code’s answer for 16 is wrong since 16 is not a prime number).

The reason is that sum_{i=1}^infinity (1/2^i) = 4 * sum_{i=1}^infinity (1/5^i) ]]>

The estimate n/(p-1) comes from estimating the floor of n/p^k by just ignoring the floor function. So the estimate is an over estimate every time n is not divisible by a power of p. Of course, this happens infinitely often, but most of the time it happens in the “tail” when p^k>n. This tail contributes 1/(p-1) to the sum, and so for our purposes is irrelevant. To get the correct count, then, requires counting finitely many overestimates.

Since 2012 is less than 5^5, there are for overestimates for the p=5 case, totaling 2/5+12/25+12/125+137/625~1.2. When p=2, the overestimates are 4/8+12/16+…, which is already more than 1.2. So if I have not made an error, there are more trailing zeros mod 15 than mod 16, but not by very many.

]]>The estimate n/(p-1) comes from estimating the floor of n/p^k by just ignoring the floor function. So the estimate is an over estimate every time n is not divisible by a power of p. Of course, this happens infinitely often, but most of the time it happens in the “tail” when p^k>n. This tail contributes 1/(p-1) to the sum, and so for our purposes is irrelevant. To get the correct count, then, requires counting finitely many overestimates.

Since 20121.2. So if I have not made an error, there are more trailing zeros mood 15 than mod

]]>