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

Function Problem12

project_euler/problem_12/problem12.go:28–36  ·  view source on GitHub ↗
(limit uint)

Source from the content-addressed store, hash-verified

26package problem12
27
28func Problem12(limit uint) uint {
29 triangle := uint(0)
30 for i := uint(1); ; i++ {
31 triangle += i
32 if numDivisors(triangle) >= limit {
33 return triangle
34 }
35 }
36}
37
38func numDivisors(n uint) uint {
39 divisors := uint(0)

Callers 2

TestProblem12_FuncFunction · 0.85
BenchmarkProblem12_FuncFunction · 0.85

Calls 1

numDivisorsFunction · 0.85

Tested by 2

TestProblem12_FuncFunction · 0.68
BenchmarkProblem12_FuncFunction · 0.68