Browse Source

little fix

Ethosa 3 years ago
parent
commit
2e6e0c4e4d
1 changed files with 1 additions and 1 deletions
  1. 1 1
      Languages/js-rush/task8/main.js

+ 1 - 1
Languages/js-rush/task8/main.js

@@ -7,7 +7,7 @@ function main() {
 function legendre(p, n) {
     var sum = Math.floor(n/p)
         pow = p*p
-    while (n > pow){
+    while (n >= pow){
         sum += Math.floor(n/pow)
         pow *= p
     }