Bill Allombert on Mon, 25 Nov 2024 18:04:56 +0100


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: Managing 'series' of logs


On Mon, Nov 25, 2024 at 10:56:38AM -0500, Charles Greathouse wrote:
> It comes up a lot in analytic number theory to manipulate functions with
> lots of logarithms. In general these look something like
> 
> x^e0 * log(x)^e1 * log(log x)^e2 * ...
> 
> or sums of such products. For context, these are a special case of
> Hardy's logarithmico-exponential functions (see Orders of Infinity), which
> I believe are further generalized by Hardy fields.
> 
> The kinds of things I do with these objects is simple: multiplication,
> addition, composition. It's basically arithmetic, but I'd like to be able
> to do it automatically for the same reason I like to do arithmetic on the
> computer: it's faster and less error-prone. For each page of symbols I move
> around, there's a nontrivial chance I'll make a mistake or misread a
> figure, and then the whole calculation is lost.
> 
> So I was wondering if there was a good way to do this in PARI/GP? I've been
> able to do some amount of this, poorly, in Mathematica; it doesn't seem to
> have a built-in notion of what to do, but I can prod it to do what's needed
> by taking various limits. But at the end of the day none of this is very
> complicated, so I was hoping to have a better approach.
> 
> As an example of what I'm trying to do, take this problem:
> 
> The n-th prime, for n >= 39017, is between f_1(n) and f_k(n) with k =
> 0.9484, with f_v(x) = n*(log n + log log n - k). What is f_v(f_v(n))? By
> hand, I get n log(n)^2 + 3n log n log log n + ....

I would do it that way (like in one of the little games):
Set 'in your head' lx = log(x) and ilx = 1/log(x) for various "x".
and use the formula
log(a+b) = log(a) + log(1+b/a)
The problem is that PARI power series assume x goes to 0, so we need to
do the computation in term of 1/log(n) (which goes to 0).
so set

iln; n; ln; lln; k; \\ variable order is important
ln = 1/iln
f = n*(ln + lln - k)
lf = (ln + lln) + log(f/(n*ln))
llf = lln + log(lf/ln)
ff = f * (lf + llf - k)

and you get something like:
n*iln^-2+(3*lln-2*k)*n*iln^-1+(2*lln^2+(-3*k+2)*lln+(k^2-k))*n+(lln^2+(-2*k+1)*lln+(1/2*k^2-k))*n*iln+....

which means:

n*log(n)^2 + 3*n*log(n)*log(log(n)) -2*k*n*log(n) +2*log(log(n))^2*n (-3*k+2)*log(log(n))*n + (k^2-k))*n +...

Cheers,
Bill.