\\ --------------- GP code --------------------------------------- \\ \\ Time-stamp: \\ Description: Compute the p-adic Gamma function (using an expansion \\ due to Dwork) \\ \\ File: /home/villegas/.public_html/cnt/gammap.gp \\ \\ Original Author: Fernando Rodriguez-Villegas \\ villegas@math.utexas.edu \\ University of Texas at Austin \\ \\ Created: Wed May 10 2000 \\ \\----------------------------------------------------------------- \\ Using Dwork's expansion, compute \\Gamma(px+1)=-\\Gamma(px) with x a \\ unit. \\ See p$-Adic Gamma Functions and Dwork Cohomology, \\ Maurizio Boyarsky \\ Transactions of the American Mathematical Society, \\ Vol. 257, No. 2. (Feb., 1980), pp. 359-369. gadw(x,p,n,bd)= {local(u,t,s); u=vector(p); if(n,,n=20); if(bd,,bd=20); s=1+O(p^bd);t=s; u[1]=s; for(j=1,p-1,u[j+1]=u[j]/j); for(k=1,bd-1, u[1]=(u[1]+u[p])/k/p; for(j=1,p-1,u[j+1]=(u[j]+u[j+1])/(k*p+j)); t=t*(x+k-1); s=s+u[1]*p^k*t); -s } \\======================================================================== \\ p-adic Gamma function for x a p-adic integer gammap(x)= {local(n,k,p,bd); p=component(x,1); n=padicprec(x,p); k=truncate(x*(1+O(p))); k=k%p; bd=n+2*n\p; if(k, x=(x-k)/p; k=k-1; prod(j=1,k,p*x+j,(-1)^k*gadw(x,p,n,bd)), -gadw(x/p,p,n,bd)) } {helpgammap()= print("-------------------------------------------------------------------"); print(" Computational number Theory "); print("-------------------------------------------------------------------"); print(""); print("Description: Routines for computing the p-adic Gamma function using an expansion due to Dwork"); print(""); print("Original Author: Fernando Rodriguez-Villegas"); print(" villegas@math.utexas.edu"); print(" University of Texas at Austin"); print(""); print("With the assistance of: Ariel Pacetti"); print(" apacetti@math.utexas.edu"); print(" University of Texas at Austin"); print("-------------------------------------------------------------------"); print(""); print("List of routines' "); print(""); print("gadw gammapalg"); print(""); } addhelp(gadw,"Using Dwork's expansion, compute \Gamma(px+1)=-\Gamma(px) with x a unit. See p$-Adic Gamma Functions and Dwork Cohomology, Maurizio Boyarsky Transactions of the American Mathematical Society, Vol. 257, No. 2. (Feb., 1980), pp. 359-369."); addhelp(gammapalg,"the routine gammap computes the p-adic Gamma function for x a p-adic integer");