Karim Belabas on Tue, 16 Jul 2013 22:33:12 +0200

 Re: Expected length of dirmul

```Hi Frank,

* Frank Thorne [2013-07-16 21:54]:
> Using Pari/GP 2.5.1 under Mac OSX. If I use dirmul to multiply two
> Dirichlet series, what will the length of the output be?

The min of lg(x)*v(y) and lg(y)*v(x), where lg() is the length and
v(x) is the "valuation" of x, i.e. the index of the smallest non-zero
coefficient in the series.

[...]
> \\ Compute the main term of Theorem 2.5, as a Dirichlet series.
> \\ Works for quadratic resolvent D, and computes to a length of N.
> {
> compute_main_dirichlet(D, N) =
>   local(EP1, p1, temp);
>   EP1 = vector(N);
>   temp = vector(N);
>   if (D > 0, EP1[1] = 1/2);
>   if (D < 0, EP1[1] = 1/6);
>   EP1 = dirmul(EP1, M_one(D, N));
>   for (p1 = 2, N,
>     if (isprime(p1),
>      if (kronecker(-3*D, p1) == 1, \
> 	temp[p1] = 2,
> 	temp[p1] = 0;
>       );
>      EP1 = dirmul(EP1, temp);
>      print(length(EP1));
>      temp[p1] = 0;
>   ));
>   EP1;

Minor improvement for this main loop:

forprime (p1 = 2, N,
temp[p1] = if (kronecker(-3*D, p1) == 1, 2, 0);
EP1 = dirmul(EP1, temp);
print(length(EP1));
temp[p1] = 0;
);

( Identical behaviour to the one you report, this is just a rewriting. )

> }
>   ***   at top-level: cmd(-3,100)
>   ***                 ^-----------
>   ***   in function cmd: ...p[p1]=2,temp[p1]=0;);EP1=dirmul(EP1,temp);pri
>   ***                                                ^--------------------
>   *** dirmul: overflow in lg().
>   ***   Break loop: type 'break' to go back to GP
>
> However, if I set temp[1] = 1, then the Dirichlet series does not
> grow after multiplication.

What is this code supposed to compute ?

As far as I understand, in the for loop, 'temp' contains at most one
non-zero term (corresponding to 2p^(-s) if kronecker(-3*D,p) = 1, and 0
otherwise). So the result as N -> +oo must be identically 0.

Maybe direuler() would be closer to what you're trying to achieve ?

Cheers,

K.B.
--
Karim Belabas, IMB (UMR 5251)  Tel: (+33) (0)5 40 00 26 17
Universite Bordeaux 1          Fax: (+33) (0)5 40 00 69 50
351, cours de la Liberation    http://www.math.u-bordeaux1.fr/~kbelabas/
F-33405 Talence (France)       http://pari.math.u-bordeaux1.fr/  [PARI/GP]
`

```