aboutsummaryrefslogtreecommitdiff
path: root/Math
diff options
context:
space:
mode:
authorAnthony Wang2020-09-19 11:18:23 -0500
committerAnthony Wang2020-09-19 11:18:23 -0500
commitc4c22328680620a5f2ae2f555ae475af83771eff (patch)
treed34d8f04f3d6b5282cedfd347c58e66138f34a24 /Math
parent64ad955a27e7fe22de08d4f412cb96651d4e3524 (diff)
Update primes.cpp
Diffstat (limited to 'Math')
-rw-r--r--Math/primes.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/Math/primes.cpp b/Math/primes.cpp
index 882cae9..0647155 100644
--- a/Math/primes.cpp
+++ b/Math/primes.cpp
@@ -33,7 +33,7 @@ vector<ii> factorize(ll N) {
ll num_pf(ll N) {
ll idx = 0, pf = pr[idx], ans = 0;
- while (N != 1 && pf * pf <= N)) {
+ while (N != 1 && pf * pf <= N) {
while (N % pf == 0) { N /= pf; ans++; }
pf = pr[++idx];
}
@@ -52,7 +52,7 @@ ll num_diff_pf(ll N) {
ll sum_pf(ll N) {
ll idx = 0, pf = pr[idx], ans = 0;
- while (N != 1 && pf * pf <= N)) {
+ while (N != 1 && pf * pf <= N) {
while (N % pf == 0) { N /= pf; ans += pf; }
pf = pr[++idx];
}
@@ -61,7 +61,7 @@ ll sum_pf(ll N) {
ll num_div(ll N) {
ll idx = 0, pf = pr[idx], ans = 1;
- while (N != 1 && pf * pf <= N)) {
+ while (N != 1 && pf * pf <= N) {
ll power = 0;
while (N % pf == 0) { N /= pf; ++power; }
ans *= (power + 1);
@@ -90,4 +90,4 @@ ll phi(ll N) {
pf = pr[++idx];
}
return N != 1 ? ans - ans / N : ans;
-} \ No newline at end of file
+}