Let $f(n)$ for $n\in\mathbb N$ be a function that increases the prime index of each prime factor of $n$ (with multiplicity) by $1$.

e.g. $f(20)=f(2^2\cdot 5)=f(p_1^2\cdot p_3)=p_{2}^2\cdot p_{4}=3^2\cdot 7=63$.

Let the set $S_n=\{n< s< 2n : f(s)\leq 2n\}$, for any $n\in\mathbb N$.

If you take the mean of $\frac{f(s)}{s}$ for each element $s \in S_n$, empirical results for $n \leq 10^8$ strongly suggest that this mean converges:

$$\lim_{n\to\infty} \left(\frac{1}{|S_n|}\sum_{s \in S_n} \frac{f(s)}{s}\right)=\frac{\log 2^{\pi}}{\log {2\pi}}\approx 1.18484.$$


Can anyone explain why this should be so? My motivation in asking is as part of a larger study of the behavior of $f$, and this result seems too nice and tidy to ignore without investigation. If anyone can explain the origin of the RHS term, or show that it is not a limit after all, I'll consider this question answered.

As a rough picture of what empirical results I'm referring to, here's a plot of this mean as $n$ increases by a factor of $1.1$ each step to nearly $10^8$:


It appears convincingly centered around $\frac{\log{2^\pi}}{\log{2\pi}}$, which seems much more plausible than any other nearby constants I could find, and it's varying by around $10^{-6}$ at the tail end there.

Per request, Mathematica code to generate plot. This was quick 'n dirty and I'm certain it could be optimized to run much faster. Use Alt+. to halt execution.

ClearAll[f, dyn];

f[1] = 1;
f[n_, k_ : 1] := Times @@ (NextPrime[#1, k]^#2 &) @@@ FactorInteger@n;
SetAttributes[f, Listable];
SetAttributes[dyn, HoldAll];

dyn[expr_, symbols_List : {}, interval_ : \[Infinity]] := 
  Dynamic[Refresh[expr, TrackedSymbols :> symbols, 
    UpdateInterval -> interval]]]

tab = {};
disp := Column[{Length@tab, n, ListLinePlot[Last/@tab, ImageSize -> Large], 
     Reverse@tab, {Style["n", Bold], Style["S mean", Bold]}], 
    Dividers -> All, Alignment -> {Left, Top}]}]
dyn[disp, {tab}];

n = 100;
 s = Select[f[Range[n + 3 - Mod[n, 2, 1], 2 n, 2], -1], # > n &];
 m = Mean[N[f@#, 8]/# & /@ s];
 AppendTo[tab, {n, m}];
 n = Ceiling[1.1 n];
  • 2
    $\begingroup$ How did you think of $2^\pi$ and $2\pi$ $\endgroup$
    – FShrike
    Commented Apr 16, 2022 at 14:43
  • 3
    $\begingroup$ @FShrike Well, I cheated... I plugged in 1.1848 to Wolfram Alpha, and it gives a handful of plausible expressions for nearby constants, of which that one seemed the best fit. $\endgroup$
    – Trevor
    Commented Apr 16, 2022 at 14:45
  • 2
    $\begingroup$ More generally one can ask about the distribution of $f(s)/s$. If the limiting distribution has a nice density function, then the answer to your question should be possible to read off from this function restricted to $[1,2]$. $\endgroup$
    – Wojowu
    Commented Apr 16, 2022 at 15:08
  • 3
    $\begingroup$ Consider posting this to MO. This is a cool observation! $\endgroup$ Commented Apr 19, 2022 at 21:29
  • 2
    $\begingroup$ The Erdos-Wintner theorem encyclopediaofmath.org/wiki/Erd%C5%91s%E2%80%93Wintner_theorem applied to the function $\log \tfrac{f(n)}{n}$ shows that $f(s)/s$ has a limiting distribution. But it is almost never possible to get explicit formulas for the limiting distributions coming this theorem, so your formula is a mystery to me. $\endgroup$ Commented Apr 21, 2022 at 14:26

1 Answer 1


It is a general result in analytic number theory that if $g(n)$ is any completely multiplicative function (meaning $g(mn)=g(m)g(n)$ always) such that $g(p)$ is asymptotically $1$, then $$ \frac1x\sum_{n\le x} g(n) \sim \prod_p \biggl( 1-\frac1p \biggr) \biggl( 1-\frac{g(p)}p \biggr)^{-1}, $$ where the product is a convergent product over all primes. (The same holds if the range of summation is $x<n\le 2x$.) If we apply this to $g(n) = n/f(n)$, using the notation $p_\rightarrow$ for the prime following $p$, then we get $$ \frac1x\sum_{n\le x} \frac n{f(n)} \sim \prod_p \biggl( 1-\frac1p \biggr) \biggl( 1-\frac{p/p_\rightarrow}p \biggr)^{-1} = \prod_p \biggl( 1-\frac1p \biggr) \biggl( 1-\frac1{p_\rightarrow} \biggr)^{-1} = \frac12 $$ since the product telescopes. On the other hand, applying this to $g(n) = f(n)/n$ yields $$ \frac1x\sum_{n\le x} \frac{f(n)}n \sim \prod_p \biggl( 1-\frac1p \biggr) \biggl( 1-\frac{p_\rightarrow}{p^2} \biggr)^{-1} \approx 4.128, $$ which is unlikely to have anything to do with any constant we've seen before.

I think the assumption that either of the other two limits in the OP is a "plausible" constant is extremely unlikely. I would bet against either of the two proposed constants being correct; both are likely to be at least as complicated as the last infinite product above, and probably more complicated because (as David E Speyer describes) the mean values are measuring something even more particular about these functions' limiting distributions than their average values.


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .