tghoster,
<script>
function diff(max, min) {
max = max.split("").reverse();
min = min.split("").reverse();
var len = Math.max(max.length, min.length),
result = [];
for (var i = 0, b = 0, c = 0; i <= len; i++) {
b = (+max[i] || 0) + (+min[i] || 0) + c;
result[i] = b > 9 ? (c = 1, b - 10) : (c = 0, b)
}
return result.reverse().join("").replace(/^0+/, "")
}
function getFactZeros(x){
var z = 0;
while(x){
x = (x/5)|0;
z+=x;
}
return z;
}
function sum(x, y) {
var res = "0";
for (var i = 0; i < y; i++) res = diff(res, "" + x);
return res
}
var re = /(?=\B(?:\d{3})+(?!\d+))/g;
var result = "1";
var r = 225;
for (var i = 1; i <= r; i++) {
result = sum(result, "" + i);
var n = result.replace(/.*?(0*$)/,"$1");
document.write(i + " => " + result.replace(re, " ") + " => " + n + " => " + n.length +" => " +getFactZeros(i)+ "<br><hr>")
};
</script>