summaryrefslogtreecommitdiff
path: root/radix_info.go
AgeCommit message (Collapse)Author
2023-11-12Denest radix_info.goAdrien Hopkins
2023-10-09Add more tests & fix found bugsAdrien Hopkins
- 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).
2023-09-23Add license (GPL v3-only) & copyright noticesAdrien Hopkins
2023-09-12Add option to show digit map onlyAdrien Hopkins
This is intended to allow users to easily view the digit maps of many different radices at once by running the program multiple times.
2023-09-07Add ability to display specific totative digitsAdrien Hopkins
Instead of just saying how many totative digits there are, the new -t flag allows the user to determine the specific digits. All totatives will end in one of these digits, and all primes are either factors or totatives. This feature is not useful in comparing radices, only learning one you have already chosen. Because there can be so many totatives (p - 1 of them for primes!), this is not displayed by default. The digit map (without -f) gives this information, and beyond its range every number will have more than 8 totatives, so do not use this flag if you only want the count.
2023-09-07Calculate type of all radices without -lAdrien Hopkins
factors.Type now supports all numbers; I have used lookup arrays instead of determining whether a number is SAN or not. There are only 117 elements to store, and this makes the algorithm Θ(1), so it's an improvement. Also, I have changed the size of some integer values to correspond to this change - they now indicate the size of numbers they can accept. The only outputs that are hidden for large radices are: - The digit map, which goes up to 36 because I don't have any more digits beyond that point - The multiplication table complexity, which is estimated above 2^16 (for performance), and can optionally be extended to 2^32 (above this, the output could overflow a uint64).
2023-09-05Unexport everything outside factors pkgAdrien Hopkins
because it's not public API!
2023-09-05Treat radices >2^16 as large unless -l setAdrien Hopkins
These radices are large enough that: - there is no reason to use them as actual radices - calculating them takes a lot of time! Therefore, the exact MTC and radix type shouldn't be calculated by default. If you want to take the time, you still can with -l. I am keeping the original 2^32 limit even with -l, because the problem with that is not performance, it is that the resulting MTC could overflow a uint64 (also the CAN list only goes up to this range).
2023-09-04Add ability to show full digit mapsAdrien Hopkins
Full digit maps will show every digit from 0 to 35, regardless of the radix. This allows you to see extra fractions for small radices and to get a digit map for radices above 36. This isn't enabled by default because the extra "digits" added for small radices aren't actually digits - so it may be unintuitive. There are also some situations where only a radix's actual digits matter, such as multiplication tables.
2023-09-01Add cmdline help & version infoAdrien Hopkins
2023-08-30Add compact displayAdrien Hopkins
2023-08-30Move argument parsing to separate file/functionAdrien Hopkins
2023-08-30Extract factor info into separate structAdrien Hopkins
This achieves two things: - Decouples my code by putting the printing code into its own file - Makes it easier to make alternate ways of printing (e.g. a compact mode)
2023-08-30Print digit map to stdoutAdrien Hopkins
2023-08-30Add digit map calculationAdrien Hopkins
This is not in the output yet, but it will be soon - printing it is another task since I want colours in my output.
2023-08-25Limit MTC calculation to < 2^32Adrien Hopkins
This ensures the output can fit into a uint64. Also, calculating it at this stage is slow, and not calculating it can make the program nearly instant even for very large numbers!
2023-08-23Add radix type to outputAdrien Hopkins
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.
2023-08-21Add ln to outputAdrien Hopkins
A radix's logarithm determines how well it compresses digits - a higher logarithm means numbers will take up fewer digits. If c = log(a)/log(b), then numbers in radix b will be around c times longer than numbers in radix a.
2023-08-21Add MTC to outputAdrien Hopkins
(MTC = Multiplication Table Complexity)
2023-08-21Upgrade to Go 1.21Adrien Hopkins
Use methods from the new slices and maps modules to make my code faster and more compact.
2023-08-21Add 2345 Score to outputAdrien Hopkins
2023-08-21Add totative ratio and factor score to programAdrien Hopkins
2023-08-18Add list of factors to outputAdrien Hopkins
2023-08-18Add functionality to print prime factorizationAdrien Hopkins