aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Manring <michael@manring>2022-07-26 12:29:29 +0700
committerMichael Manring <michael@manring>2022-07-26 12:29:29 +0700
commitf54a0279ce01c97651be9ea5597c5d672b34f049 (patch)
treecd38e39ad9dc57595df2684c87356ac7081f06d5
parente13783210a31cb796eeb123f1b8130e7f13a158b (diff)
downloadperlweeklychallenge-club-f54a0279ce01c97651be9ea5597c5d672b34f049.tar.gz
perlweeklychallenge-club-f54a0279ce01c97651be9ea5597c5d672b34f049.tar.bz2
perlweeklychallenge-club-f54a0279ce01c97651be9ea5597c5d672b34f049.zip
pwc175 solution in go - minor update
-rw-r--r--challenge-175/pokgopun/go/ch-2.go7
1 files changed, 4 insertions, 3 deletions
diff --git a/challenge-175/pokgopun/go/ch-2.go b/challenge-175/pokgopun/go/ch-2.go
index 7e805c20b7..51106c56a2 100644
--- a/challenge-175/pokgopun/go/ch-2.go
+++ b/challenge-175/pokgopun/go/ch-2.go
@@ -21,12 +21,13 @@ import (
)
func main() {
- p := totient.New()
- cntdwn := 20
+ var cntdwn uint = 20
+ p := totient.New(cntdwn)
var b strings.Builder
- for i := uint(0); i < 10_000; i++ {
+ for i := uint(3); i < 200_000; i += 2 {
if p.IsPerfect(i) {
b.WriteString(", " + strconv.FormatUint(uint64(i), 10))
+ //fmt.Println(i)
cntdwn--
}
if cntdwn == 0 {