From a663fa77cde6ad48f29abd6973211c179ff32464 Mon Sep 17 00:00:00 2001 From: Adrien Hopkins Date: Mon, 4 Sep 2023 18:51:26 -0500 Subject: Increase detail of digit map neighbours It now distinguishes between omega (factors of r - 1), alpha (factors of r + 1) and the rest. The previous categorization determined whether or not totatives and semitotatives have simple patterns; this new categorization determines which simple patterns they follow) --- factors/digit_map.go | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) (limited to 'factors/digit_map.go') diff --git a/factors/digit_map.go b/factors/digit_map.go index e78cce0..db562db 100644 --- a/factors/digit_map.go +++ b/factors/digit_map.go @@ -12,9 +12,18 @@ type TotativeType uint8 const ( // This number does not have any totative factors Regular TotativeType = iota + // This number's totative part is divisible by (r - 1) + // - this gives it the simplest possible decimal expansion + // for a non-regular (1 digit repeating) and a simple divisibility + // test (sum digits, like 3 or 9 in decimal) + Omega + // This number's totative part is divisible by (r + 1) + // - this makes it slightly more complicated than omega + Alpha // This number's totative part is divisible by (r^2 - 1) - // - this makes it easier to work with - Neighbour + // but not (r + 1) or (r - 1) + // - these totatives straddle the line between simple and complex + Pseudoneighbour // This number's totative part is not divisible by (r^2 - 1) // - it will not be nice to work with Opaque @@ -56,7 +65,11 @@ func (dt DigitType) String() string { tString = "0" case Regular: tString = "R" - case Neighbour: + case Omega: + tString = "ω" + case Alpha: + tString = "α" + case Pseudoneighbour: tString = "N" case Opaque: tString = "P" @@ -100,8 +113,12 @@ func calcTotativeType(totative, radix uint) TotativeType { return Zero case totative == 1: return Regular + case (radix-1)%totative == 0: + return Omega + case (radix+1)%totative == 0: + return Alpha case (radix*radix-1)%totative == 0: - return Neighbour + return Pseudoneighbour default: return Opaque } -- cgit v1.2.3