From eeff1f3c61fad805bb5ce0170e98378c3b706c18 Mon Sep 17 00:00:00 2001 From: Adrien Hopkins Date: Mon, 9 Oct 2023 13:35:04 -0500 Subject: Add more tests & fix found bugs - TotativeDigits was defined incorrectly, previously counted totatives from 0 to r-1, now counts digits from 1 to r. This ensures that len(TotativeDigits(r)) = Totient(r). --- factors/score.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'factors/score.go') diff --git a/factors/score.go b/factors/score.go index c777d11..00988c9 100644 --- a/factors/score.go +++ b/factors/score.go @@ -34,7 +34,7 @@ func Score(n uint) float64 { return float64(factorSum) / float64(n) } -const maxSmall = 1 << 28 - 1 +const maxSmall = 1<<28 - 1 func bigScore(n uint) float64 { factorSum := new(big.Int) -- cgit v1.2.3