We've covered quite a bit here.
Yes. Yes we have.
Despite that, the topics here certainly haven't exhausted my own personal questions. If anything, I'm just left with more. So I do want to note some of those questions.
Go ahead.
We worked through a number of examples where we started with our basic recursive form for $\Pi(n)$, and then we extended it by altering the definition with a helper function. And that usually had some interesting mathematical impact.
Right.
So, needless to say, one obvious and basic question is if there are other such helper functions that might be similarly insightful somehow.
That makes sense, sure.
Such an example that I left criminally uncovered here - as I mostly avoided complex numbers - is the following. If $\chi(j)$ is some Dirichlet character, and you define $f_k(n,j)$ as $$f_k(n,j)=\rec{\rr{\chi(j) \cdot }(\frac{1}{k}-f_{k+1}(\frac{n}{j},2)) + f_k (n, j+1)}$$ then you can compute a weighted prime power count, with Dirichlet characters applied, as $$f_1(n,2) = \sum_{p^k \le n} \frac{\chi(p^k)}{k}$$ So that's one such example of what I'm talking about.
That makes sense.
At any rate, many of the helper functions we looked at connected to $\log \zeta(s)$ in some straightforward way, so that suggests a bunch of well understood such helper functions from the $\log \zeta(s)$ equivalents. But I am curious if there are other such helper functions that particularly interact with the partial sum nature of the convolutions in interesting or unexpected ways, as was the case with the original alternating series exploration.
Right, I can see that as an interesting line of questioning. There might be fascinating ideas that show up in the partial sum convolution context that disappear in the limit, you mean.
I also remain really curious about a wide range of topics we brushed up against when we generalized between addition and multiplication. I don't have anything specific to say here, other than to note that it seems like a fascinating space with lots of possible questions - or that's my reaction, anyway.
Certainly.
If I'm honest, my biggest current question springing from the ideas we covered hinges on the intersection between our discussion about smoothing, recentering, and expressing these recursive formulas in a way that captures key symmetries. As I noted, we worked through several different methods of connecting the weighted count of primes $\Pi(n)$ to the logarithmic integral $\mathrm{li}(n)$, which is obviously a topic of considerable interest. I remain curious if any of these forms can be evolved or developed to say anything interesting analytically.
So, right. Those are topics of some interesting to me, anyway.
Alright. I hope the range of animations, running code, and discussions here has been engaging and curiosity-provoking. I really hope, especially, that the connections here between $\Pi(n)$ and $\mathrm{li(n)}$ come across as natural and compelling to anyone following along as they do to me.
Fourier / Laplace / Mellin transforms are fascinating, powerful, and beautiful for all sorts of reasons, but certainly in the context of the kinds of ideas we've explored here, their ability to convert convolution into multiplication must be one of their most almost magical features. But their introduction really does come at the expense of introducing some seriously challenging mathematical concepts along the way. Because normal current programming languages have a lot more aptitude at crunching through convolution calculations than they do wrestling with analytic questions of convergence, I hope at the very, very least that these articles are a nice model of what leaning into that fact might look like.
Anyway, if you've followed along with me this far, thanks so much! I hope you found something interesting and worthwhile in all of this!
Nathan McKenzie
August 2025
Dedicated to Eleanor, Will, and Bev, who didn't know their role in all this, and Annette, who did a bit
And a big thanks to the following indispensable JavaScript libraries: KaTeX, rainbow, d3, function-plot, math, and vis
P. S. I have a lot more incomplete animations, live code, and other number theory and math explorations like this that I'm trying to put out publicly. But I'm struggling to find a way to make this work, just in terms of time and resources. If you happen to be on friendly terms with any wealthy benefactors / tech moguls / foundation heads, or are yourself such a person, and this work is the sort of thing you'd appreciate supporting, let let me know!
I'd like to include a bit of personal history connected to these ideas at the end here. Feel free to skip this bit if you're just here for the exciting animating graphs.
Of course, of course.
I hope the discussion here has been useful, interesting, curiosity-provoking, and that it all stands on its own as some kind of resource.
To be a bit explicit, many results here are the product of my own incessant questioning, computational exploration, and fiddling with equations. I absolutely try to reference other sources if I'm familiar with them at the time of writing, but as a fairly solitary amateur, I just have limits on how wide my knowledge is of prior results. And for better or worse, my own personal curiosities, and the questions I want to ask, about math seem somewhat out of sync with certain broader tendencies in academic math. So I end up doing a lot more computational experiments than reading rigorous papers. I intend this as neither an apology nor a defense, but simply a pragmatic reflection. So think of this as a travelogue. I went here, I dug through this, here were my efforts to understand what I found, this was fascinating to me.
Given that general preamble, though, here is a bit more specific personal history on that front...
So this series of discussions, in particular, telescopes a quite dizzying range of time for me. It smashes together a lot of quite disparate experiences that I worked through.
How so?
Well, the core of the original recursive form, or at least my own experience with it, dates back to work I did in October of 2004. I've written about my actual history of that specifically at very great length elsewhere.
Right.
The smoothed version, the one producing the logarithmic integral $\mathrm{li}(n)$, is the first variation I went on to explore. My time with that idea dates back from September of 2005. I dumped a bunch of results unceremoniously in sci.math on February 20th, 2006, and this idea was referenced in there, so that is a bit of public record. That whole experience was my first little nudge in the direction of injecting the tiniest little bit of calculus into my explorations. At the time, owing to my computational focus and reckless experimenting, I was much better equipped to stick with more discrete, combinatorial explorations. That fact wouldn't really change until I got a second hand copy of Mathematica in 2011, at which point reckless computational experiments with calculus become more reasonable.
I spent several years certain the curve that resulted from smoothing must've been the logarithmic integral, but I didn't know how to show that, given my anemic calculus background. So I was grateful to be helped along, and usefully introduced to the incomplete gamma function along the way, by this math.stackexchange question.
So those two ideas came in quick succession.
More or less. I had a gap after that, though, where I focused much more intensely on indie game development, so the attention I dedicated towards number theory exploration waned for a while. But it did pick up a bit in early 2011. Around the time that I evolved my $O(n^{\frac{2}{3}+\epsilon}) $ time, $ O(n^{\frac{1}{3}+\epsilon}) $ space prime counting algorithm, I had a burst of enthusiasm, as well as my first really shaky attempts at writing up a bunch of results, a topic I still struggle with to this day. It was during that window of time I explored different relationships between the generalized count of divisors $d_z(n)$ and the weighted count of prime powers $\frac{\Lambda(n)}{\log n}$, which led to some of the observations I reference in this discussion.
Okay. And then?
Well, by mid 2013, my daughter had been born, which made me a parent. My ability to sustain concentration for indie game development was well and truly shot, and I started spending more time fiddling with Mathematica. This arrangement proved to be more fertile ground for me to turn attention back to my various number theory questions and curiosity.
That seems counterintuitive; surely new parenthood ought to be the bane of exploring math.
Yeah, I suppose it is a bit ironic. But that is indeed how I experienced it all. For whatever reason, I found fiddling with my various open number theory questions and experimenting a good fit for keeping an eye on a small child. So in September, I started digging into the early observations that would evolve into the topic of generalizing alternating series and connecting the weighted count of prime powers to the logarithmic integral that way as I've detailed earlier. I elaborated on this idea, off and on, through the end of 2013 and some of 2014. This mathoverflow question captures that process a bit, as does this math stackexchange question.
And so this arrangement led you to spend more time on number theory questions?
It did. My son was born in 2015, and among other things, that was the year that I worked through the symmetry respecting recursive forms for expressing the different prime counting functions. My original method for counting primes, all the way back in 2004, had functionally relied on the core idea present in the Dirichlet hyperbola method, and that was a crucial element in making the first version of the algorithm at all fast. So that connection had long stuck with me. But the form in which I had had expressed that idea up to that point had been applied directly to the various count of divisors functions. In fact, you can see me wrestling with that question in 2012 in this mathoverflow question. And it remains an open question for me. Anyway, I had long wondered if there was some way to express the weighted count of prime powers directly, harnessing that idea. And in 2015, I finally figured out how to write such a function.
In the same year, in early October, I also turned to the additive equivalent I discuss here, the one connected to harmonic numbers, which honestly, as I've presented it here, doesn't seem like the most striking idea in the world. Starting back in 2005 with the smoothing idea, I'd spent more and more time mulling a general question that might be expressed as, "What are the various relationships between a specific kind of discrete and continuous convolution?" Noticing this identity turned my attention to a second similar line of question, "What are the various relationships between a specific kind of additive and multiplicative convolution?" And that led me to a lot more fruitful (to me) questions, which I cover in much greater detail here and here and here. When I look at this history, though, I am also struck by how backwards I've gone about things; the additive versions of everything are much, much simpler and straightforward, and if I worked in a sensible way, I would have obviously encountered them first.
I won't draw out the specific references right now, but in June of 2017, I publicly uploaded a very large amount of incomplete documents, scratch notes, unsorted Mathematica notebooks, and very unfinished websites to my github account here, though this was more of a document dump than anything truly fit for public consumption. Still, many of the results covered in this series of discussions are found peppered through those messy documents and Mathematica notebooks.
Okay. Is there anything else to add, in terms of personal history?
Just a bit more. The aside at the bottom of the smoothing discussion, relying on the $\mathrm{sinc}$ function, was from some exploration at February of 2018. I had long been curious (and remain so) about the different contexts where $\mathrm{li}(x)$ shows up, compared to $\mathrm{li}(x) - \log \log x$. The observations in that section still feel underdeveloped to me, though.
And the second alternating series, the revised one, I explored in March of 2018, a bit after my younger daughter was born. When I had originally been exploring questions about generalizing alternating series, I had already, at the time, puzzled out how to make that one sum converge to the logarithmic integral external to my recursive identity. At this point, though, the idea of exploring a variant that converged internally struck me, and I found the general idea of viewing it as a multi-frequency alternating series interesting on its own. But truthfully, this was the tail end of me exploring this kind of sum, and I would shortly shift my attention to questions that were more analytic in nature.
So that's that. Again, if you've read this far, I hope you got something out of this all, and thanks for working through these ideas with me!