Skip to content

Commit

Permalink
modified: Math/partial_sums_of_prime_bigomega_function.sf -- use `eac…
Browse files Browse the repository at this point in the history
…h_prime_power` instead of `is_prime_power`
  • Loading branch information
trizen committed Oct 15, 2024
1 parent 24dbf6f commit d66a6e0
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions Math/partial_sums_of_prime_bigomega_function.sf
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ func prime_bigomega_partial_sum(n, m) { # O(sqrt(n)) complexity
var total = 0

for k in (1..s) {
total += faulhaber_sum(k, m)*(prime_power_count(floor(n/(k+1))+1, floor(n/k)))
total += faulhaber_sum(k,m)*(prime_power_count(floor(n/(k+1))+1, floor(n/k)))
}

for k in (1..u) {
Expand All @@ -99,10 +99,13 @@ func prime_bigomega_partial_sum_2(n, m) {
var total = 0

for k in (1..s) {
total += (k**m * prime_power_count(floor(n/k)))
total += faulhaber_sum(floor(n/k), m) if k.is_prime_power
total += (ipow(k,m) * prime_power_count(floor(n/k)))
}

each_prime_power(1, s, {|k|
total += faulhaber_sum(floor(n/k), m)
})

total -= prime_power_count(s)*faulhaber_sum(s, m)

return total
Expand Down

0 comments on commit d66a6e0

Please sign in to comment.