MCPcopy Create free account
hub / github.com/TheAlgorithms/Go / Problem7

Function Problem7

project_euler/problem_7/problem7.go:16–27  ·  view source on GitHub ↗
(n uint)

Source from the content-addressed store, hash-verified

14import "github.com/TheAlgorithms/Go/math/prime"
15
16func Problem7(n uint) int64 {
17 count, i := uint(0), int64(1)
18
19 for count < n {
20 i++
21 if prime.OptimizedTrialDivision(i) {
22 count++
23 }
24 }
25
26 return i
27}

Callers 2

TestProblem7_FuncFunction · 0.85
BenchmarkProblem7Function · 0.85

Calls 1

OptimizedTrialDivisionFunction · 0.92

Tested by 2

TestProblem7_FuncFunction · 0.68
BenchmarkProblem7Function · 0.68