MCPcopy 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

12import "github.com/TheAlgorithms/Go/math/prime"
13
14func 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_FuncFunction · 0.85
BenchmarkProblem10Function · 0.85

Calls 1

SieveEratosthenesFunction · 0.92

Tested by 2

TestProblem10_FuncFunction · 0.68
BenchmarkProblem10Function · 0.68