rename functions
This commit is contained in:
@@ -42,7 +42,6 @@ func updateMultiples(sieve []uint, x uint, p uint, n uint) {
|
||||
if p*q >= n {
|
||||
break
|
||||
}
|
||||
println(q)
|
||||
|
||||
// sigma_x(p^k) = p^(kx) + sigma_x(p^(k-1))
|
||||
sieve[p*q] = pow(p*q, x) + sieve[q]
|
||||
@@ -50,9 +49,9 @@ func updateMultiples(sieve []uint, x uint, p uint, n uint) {
|
||||
}
|
||||
|
||||
/*
|
||||
DivisorSieve computes sigma_x(k) for k=1 to n, where sigma_x is the divisor sum function. x sets the power each divisor is raised to.
|
||||
Divisors computes sigma_x(k) for k=1 to n, where sigma_x is the divisor sum function. x sets the power each divisor is raised to.
|
||||
*/
|
||||
func DivisorsSieve(n uint, x uint, buflen uint) chan uint {
|
||||
func Divisors(n uint, x uint, buflen uint) chan uint {
|
||||
sieve := make([]uint, n)
|
||||
sieve[0] = 0
|
||||
for i := uint(1); i < n; i++ {
|
||||
|
||||
Reference in New Issue
Block a user