Bill Allombert on Thu, 21 Mar 2019 12:37:26 +0100


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

Re: Evaluating Multiple Sums in PARI/GP


On Wed, Mar 20, 2019 at 06:56:19PM +0100, Bill Allombert wrote:
> On Fri, Feb 15, 2019 at 08:28:37PM +0300, kevin lucas wrote:
> > I recently ran into problems attempting to formulate a PARI program that
> > evaluated the expression
> > 
> > sum(((-1)^(a+b+c))/(a^2 + b^2 + c^2)^s)
> > 
> > for various complex values of s, with a,b,c running over Z^3/{(0,0,0)}. How
> > should I attempt this? More generally, how should one set up iterated
> > alternating sums like these? If, for instance I also wanted the
> > eight-dimensional version of the above sum, how would I compute it?
> 
> I have created a git branch bill-lfunqf which adds support for quadratic
> forms with an odd number of variables to lfunqf.
> 
> So in this branch, you can compute
> sum(1/(a^2 + b^2 + c^2)^4)
> with 
> 
> ? L=lfunqf(matid(3));
> ? lfun(L,4)
> %30 = 6.9458079272263696241707780231117151644
> 
> The additive character can be added using the standard linear algebra
> trick.
> 
> L1=lfunqf(matdiagonal([1,1,1]));
> L2=lfunqf(matdiagonal([4,1,1]));
> L3=lfunqf(matdiagonal([4,4,1]));
> F(s)=6*lfun(L2,s)-12*lfun(L3,s)-lfun(L1,s)*(1-8/4^s)
> Where 
> F is equal to sum(((-1)^(a+b+c))/(a^2 + b^2 + c^2)^s)
> 
> (which you can check using this brute force approximation:
> h(s,B=10)=sum(a=-B,B,sum(b=-B,B,sum(c=-B,B,my(u=a^2+b^2+c^2);if(u,((-1)^(a+b+c))/u^s,0.))))
> which is accurate as long as B^s is small enough).

Also you can compute the Madelung constant:
https://en.wikipedia.org/wiki/Madelung_constant

? \p100
   realprecision = 115 significant digits (100 digits displayed)
? F(1/2)
%10 = -1.747564594633182190636212035544397403485161436624741758152825350765040623532761179890758362694607890

and check the value given there:
<https://crd-legacy.lbl.gov/~dhbailey/dhbpapers/tenproblems.pdf>

Cheers,
Bill