Coding 2025-10-22
I'm not planning to do too much today (I got seriously messed up by the sun), but I can explain more of what I did yesterday, and what I plan to do later.
Yesterday, I realized that having digit sequences as instances of base-specific classes didn't make sense to me, so I created a bunch of generic digit-sequence classes, which implemented stuff like digit sums, and will also implement stuff like palindromes. With this, I was able to convert the integer base class from a base class that must be subclassed, to just a class that must be instantiated. By messing with this, I was able to create an implementation of digital roots that is probably robust enough to go on a currently-hypothetical base class of bases. This robustness is not guaranteed by the fact that it seems to work on optionally-balanced integer bases, because in bases like maximal phinary, some small numbers are less than their own digit sum. I believe this still converges, but I've neither put in the work to establish that, nor checked whether anyone else has. And the current implementation will just OoM if I manage to come up with a sufficiently pathological base, so I guess I just shouldn't do that.
Anyway, I stumbled across a paper from thirty years ago that purports to explain which polynomials have roots that are nicely-behaved as a base, which I'm grateful for, since I've experimented with various polynomials, metallic means, and Pisot numbers, and some of them are just not well-behaved. From looking over the beginning of this paper, it looks to be saying that particular classes of polynomials will be well-behaved and usable, irrespective of degree. So that's actually very exciting; it's just too bad that sometimes it uses words that I have literally never heard before.
Anyway, let's see what I've got to work on as I feel like (which right now, I do not):
- Read the article, sketch out ideas.
- Clean up existing code (document assumptions and potential points of failure, add validation logic)
- Extend the code with new calculations.
- Implement conversion logic for new bases (rational with number of digits equal to numerator, Gaussian, Eisenstein, algebraic)
Okay, that's about the state of things, at least, things that I feel like mentioning. I'm going to wrap things up early and watch funny videos.
Good night.