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

Function Problem3

project_euler/problem_3/problem3.go:12–24  ·  view source on GitHub ↗
(n uint)

Source from the content-addressed store, hash-verified

10package problem3
11
12func Problem3(n uint) uint {
13 i := uint(2)
14
15 for n > 1 {
16 if n%i == 0 {
17 n /= i
18 } else {
19 i++
20 }
21 }
22
23 return i
24}

Callers 2

TestProblem3_FuncFunction · 0.85
BenchmarkProblem3Function · 0.85

Calls

no outgoing calls

Tested by 2

TestProblem3_FuncFunction · 0.68
BenchmarkProblem3Function · 0.68