diff options
| author | Adrien Hopkins <adrien.p.hopkins@gmail.com> | 2023-08-30 13:53:53 -0500 |
|---|---|---|
| committer | Adrien Hopkins <adrien.p.hopkins@gmail.com> | 2023-08-30 14:05:09 -0500 |
| commit | 778220b2e3ce662e733727fb9a560fcfe85c19eb (patch) | |
| tree | 38d18d3db70943b42a62f1f786777022e954bd87 /factors/factorize.go | |
| parent | b9164fb5b41136a63391f5675a848ec4a7711cb6 (diff) | |
Add digit map calculation
This is not in the output yet, but it will be soon - printing it is
another task since I want colours in my output.
Diffstat (limited to 'factors/factorize.go')
| -rw-r--r-- | factors/factorize.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/factors/factorize.go b/factors/factorize.go index 2f7368a..8e82b16 100644 --- a/factors/factorize.go +++ b/factors/factorize.go @@ -11,14 +11,14 @@ func Factors(n uint) []uint { factors := []uint{1} for p, e := range primeFactorization.exponents { - next_factors := make([]uint, 0, len(factors) * int(e)) + next_factors := make([]uint, 0, len(factors)*int(e)) for _, factor := range factors { for i := uint(0); i <= e; i++ { multiplier := uint(1) for j := uint(0); j < i; j++ { multiplier *= p } - next_factors = append(next_factors, factor * multiplier) + next_factors = append(next_factors, factor*multiplier) } } factors = next_factors |
