Merge pull request #728 from 11un/patch-2

typo "need (to) change approach.."
This commit is contained in:
Ilya Kantor 2019-01-13 20:32:00 +03:00 committed by GitHub
commit a484461394
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -26,4 +26,4 @@ for (let i = 2; i <= n; i++) { // for each i...
}
```
There's a lot of space to opimize it. For instance, we could look for the divisors from `2` to square root of `i`. But anyway, if we want to be really efficient for large intervals, we need change the approach and rely on advanced maths and complex algorithms like [Quadratic sieve](https://en.wikipedia.org/wiki/Quadratic_sieve), [General number field sieve](https://en.wikipedia.org/wiki/General_number_field_sieve) etc.
There's a lot of space to opimize it. For instance, we could look for the divisors from `2` to square root of `i`. But anyway, if we want to be really efficient for large intervals, we need to change the approach and rely on advanced maths and complex algorithms like [Quadratic sieve](https://en.wikipedia.org/wiki/Quadratic_sieve), [General number field sieve](https://en.wikipedia.org/wiki/General_number_field_sieve) etc.