From ac766f4f6ab9db683e29b093bbc48cfe3b27b2b7 Mon Sep 17 00:00:00 2001 From: Adrien Hopkins Date: Mon, 22 Sep 2025 15:56:30 -0500 Subject: Show regular complexity of prime factors This metric shows how many combinations you'll need to memorize prime powers, and how big the numbers are in complementary multiplication. The YouTube video "the best way to count" inspired me to think I need a metric to handle both size and factors, but the specific metric is entirely original (or at least independently discovered). --- factors/regular_complexity.go | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 factors/regular_complexity.go (limited to 'factors/regular_complexity.go') diff --git a/factors/regular_complexity.go b/factors/regular_complexity.go new file mode 100644 index 0000000..763bcd7 --- /dev/null +++ b/factors/regular_complexity.go @@ -0,0 +1,16 @@ +package factors + +import ( + "math" +) + +func PrimeRegularComplexities(radix uint) map[uint]float64 { + var factorization = PrimeFactorize(radix) + var complexities = make(map[uint]float64, len(factorization.exponents)) + for p, e := range factorization.exponents { + var part = float64(uintpow(p, e)) + var complexity = math.Pow(float64(radix)/part, 1/float64(e)) + complexities[p] = complexity + } + return complexities +} -- cgit v1.2.3