summaryrefslogtreecommitdiff
path: root/content/math/piLegendre.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'content/math/piLegendre.cpp')
-rw-r--r--content/math/piLegendre.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/content/math/piLegendre.cpp b/content/math/piLegendre.cpp
index 46c8584..6401a4f 100644
--- a/content/math/piLegendre.cpp
+++ b/content/math/piLegendre.cpp
@@ -16,7 +16,7 @@ ll phi(ll n, ll k) {
ll pi(ll n) {
if (n < N) { // implement this as O(1) lookup for speedup!
- return distance(primes.begin(), upper_bound(all(primes), n));
+ return ranges::upper_bound(primes, n) - begin(primes);
} else {
ll k = pi(sqrtl(n) + 1);
return n - phi(n, k) + k;