Last active
August 29, 2015 14:20
-
-
Save hueitan/6eaad3406ca84d19ec28 to your computer and use it in GitHub Desktop.
Revisions
-
Huei Tan revised this gist
May 28, 2015 . 1 changed file with 6 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -23,6 +23,12 @@ var zeroes = function z(n) { k = n/5 | 0 return k ? k + f(k) : 0 } // or function zeroes (n) { s = 0 while (n/=5) s += n|0 return s } ``` 79 char -
Huei Tan revised this gist
May 27, 2015 . 1 changed file with 6 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -17,6 +17,12 @@ function zeroes(n) { } return result; } // alternative of zeroes var zeroes = function z(n) { k = n/5 | 0 return k ? k + f(k) : 0 } ``` 79 char -
Huei Tan revised this gist
May 6, 2015 . 1 changed file with 13 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -44,4 +44,17 @@ function superfactorialZeros(N) { return R } ``` well... 71 cahr ```js function superfactorialZeros(N) { R = 0 while (j = N--) while (j /= 5) R += j & j return R } ``` -
Huei Tan revised this gist
May 6, 2015 . 1 changed file with 14 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -30,4 +30,18 @@ function superfactorialZeros(N) { return R } ``` 76 char ```js function superfactorialZeros(N) { R = 0 while (n=N--) while(n>=5) R += (n/=5)|0 return R } ``` -
Huei Tan revised this gist
May 6, 2015 . 1 changed file with 13 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -17,4 +17,17 @@ function zeroes(n) { } return result; } ``` 79 char ```js function superfactorialZeros(N) { R = 0 for (; N ; N--) for (j = 5; N >= j; j *= 5) R += N / j | 0 return R } ``` -
Huei Tan created this gist
May 6, 2015 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,20 @@ ```js function superfactorialZeros(N) { var result = 0; for (i = 1; i <= N; i++) { result += zeroes(i); } return result; } function zeroes(n) { var i = 1; var result = 0; while (n >= i) { i *= 5; result += Math.floor(n / i); } return result; } ```