diff options
| author | Adrien Hopkins <adrien.p.hopkins@gmail.com> | 2023-08-23 15:55:54 -0500 |
|---|---|---|
| committer | Adrien Hopkins <adrien.p.hopkins@gmail.com> | 2023-08-23 16:26:21 -0500 |
| commit | 24a8dde3a708b0cd95007d940e8957b21df40055 (patch) | |
| tree | 6d4036fd427f4e36651bc0237a0a1e9b74d36155 /radix_info.go | |
| parent | dc00f5c20b62de58dbad4b71792632599528c19f (diff) | |
Add radix type to output
This type measures which kind of classes each radix is a part of:
- Colossally Abundant (OEIS: A004490; factor score better than every
other number if you account for size be dividing by a certain power of
the number)
- Superabundant (OEIS: A004394; factor score better than every smaller
number)
- Ordered-Exponent (OEIS: A025487; exponents in prime factorization go
down as you get to bigger primes, and no prime is skipped)
- Practical (OEIS: A005153; factors can sum to any number below the
original number without duplication)
Each of these groups is a subset of the next, so only the most specific
label is reported.
The purpose of this program is to give you useful info to help you
determine which radices are the best, and these categories give a rough,
quantitative measure of how useful a radix's factors are:
- Practical is approximately the minimum requirement for a worthwhile
radix. Non-practical radices above ~16 are probably terrible to use.
- Ordered-Exponent radices act like local maxima - you can't get any
better (smaller) without changing the "shape" (exponents) of your prime
factorization.
- Superabundant radices are the best radices below the next
superabundant number (e.g. 12 is the best radix below 24).
- Colossally abundant radices are, in some sense, the best radices out of
all numbers.
Diffstat (limited to 'radix_info.go')
| -rw-r--r-- | radix_info.go | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/radix_info.go b/radix_info.go index 8bdfa5b..f3aecce 100644 --- a/radix_info.go +++ b/radix_info.go @@ -22,6 +22,9 @@ func main() { fmt.Printf("Totative Ratio: %03.1f%%\n", factors.TotativeRatio(n)*100.0) fmt.Println("2345 Rank:", factors.BasicRank(n)) + if n < 1<<32 { + printTypeMessage(factors.Type(uint32(n))) + } fmt.Println("Multiplication Table Complexity:", factors.MTC(n)) fmt.Printf("Natural Logarithm: %.2f\n", math.Log(float64(n))) } else { @@ -34,3 +37,16 @@ func main() { fmt.Println("Please provide an argument (radix to study).") } } + +func printTypeMessage(t factors.NumberType) { + switch t { + case factors.ColossallyAbundant: + fmt.Println("This radix is colossally abundant!") + case factors.Superabundant: + fmt.Println("This radix is superabundant.") + case factors.OrderedExponent: + fmt.Println("This radix has ordered exponents.") + case factors.Practical: + fmt.Println("This radix is practical.") + } +} |
