Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/TheAlgorithms/Go
/ Problem10
Function
Problem10
project_euler/problem_10/problem10.go:14–23 ·
view source on GitHub ↗
(n int)
Source
from the content-addressed store, hash-verified
12
import
"github.com/TheAlgorithms/Go/math/prime"
13
14
func
Problem10(n int) uint {
15
sum := uint(0)
16
sieve := prime.SieveEratosthenes(n)
17
18
for
_, v :=
range
sieve {
19
sum += uint(v)
20
}
21
22
return
sum
23
}
Callers
2
TestProblem10_Func
Function · 0.85
BenchmarkProblem10
Function · 0.85
Calls
1
SieveEratosthenes
Function · 0.92
Tested by
2
TestProblem10_Func
Function · 0.68
BenchmarkProblem10
Function · 0.68