Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
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
14
import
"github.com/TheAlgorithms/Go/math/prime"
15
16
func
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_Func
Function · 0.85
BenchmarkProblem7
Function · 0.85
Calls
1
OptimizedTrialDivision
Function · 0.92
Tested by
2
TestProblem7_Func
Function · 0.68
BenchmarkProblem7
Function · 0.68