==> arithmetic/digits/zeros/trailing.s <== The general answer to the question "what power of p divides x!" where p is prime is (x-d)/(p-1) where d is the sum of the digits of (x written in base p). So where p=5, 10 is written as 20 and is divisible by 5^2 (2 = (10-2)/4); x to base 10: 100 1000 10000 100000 1000000 x to base 5: 400 13000 310000 11200000 224000000 d : 4 4 4 4 8 trailing 0s in x! 24 249 2499 24999 249998