diff options
| author | Mohammad S Anwar <Mohammad.Anwar@yahoo.com> | 2022-07-26 09:34:18 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-07-26 09:34:18 +0100 |
| commit | d09fa92c31c053a8d246c749ee52bd2e73f653a5 (patch) | |
| tree | 4556a4b7908a9bb0609ad97e5a6a08ba79508caf | |
| parent | a7dbbf1044ad31aeb5219aa10f1b06e4703aa641 (diff) | |
| parent | f54a0279ce01c97651be9ea5597c5d672b34f049 (diff) | |
| download | perlweeklychallenge-club-d09fa92c31c053a8d246c749ee52bd2e73f653a5.tar.gz perlweeklychallenge-club-d09fa92c31c053a8d246c749ee52bd2e73f653a5.tar.bz2 perlweeklychallenge-club-d09fa92c31c053a8d246c749ee52bd2e73f653a5.zip | |
Merge pull request #6509 from pokgopun/pwc175
pwc175 solution in go - minor update
| -rw-r--r-- | challenge-175/pokgopun/go/ch-2.go | 7 |
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 { |
