Department of Mathematics FAS Harvard University One Oxford Street Cambridge MA 02138 USA Tel: (617) 495-2171 Fax: (617) 495-5132
FAS Computer Services to Harvard University IT: (617) 495-7777.
Pari/Gp is a software package for computer-aided number theory. The GPL'd package is under active development.
For an introduction, see the Pari . A short introduction to Pari on Linux . On Unix (Solaris, Linux or OS 10) Pari is started in a terminal with "gp". On Windows or Mac OS 9, Pari/Gp is an application.
Pari is an excellent calculator with infinite accuracy, useful to solve equations, find roots of polynomials etc:
 log(234234)
 12341239417623941782346*123412341234123412341234
 factor(111111111111111111111111111111111111111111111111111111111111111111111111111111111)
 factor(1+2*x+x^2)
 10!
 solve(x=0,1,cos(x)-x)
 polroots(x^3+x^2-2*x-2)
Pari knows calculus, can find Taylor series, find integrals, plot functions, find the derivatie of a function, sum a series. In that case we switched to 200 digit accuracy:
 Ser( (1-x)^(-1) )
 intnum(t=0,2*Pi,sin(exp(I*t)))
 plot(x=0,2*Pi,sin(x))
 f(x)=sin(cos(x))
 f'(x)
 p 200
 4*sumalt(k=0,(-1)^k/(2*k+1))
To work with complex numbers, just note that I is the the imaginary i.
 (1+I)*(1-I)
 abs(1+I)
For doing linear algebra, like solving a linear system A x=b or find the determinant of a matrix A:
 A=matrix(3,3,i,j,i/j+j/(i+1)*2+3)
 b=[0;1]
 gauss(A,b)
 matdet(A)
It allows programming
 f(n)=if(n==0,1,if(n==1,1,f(n-1)+2*f(n-2)))
 f(20)
An example of a program is pollard.gp , which factors numbers using the Pollard rho method. In Pari, read the file with
 
 pollard.gp
More Pari documentation can be found here .


Simplicity, Clarity, Generality B.W. Kernighan, R. Pike, in "The Practice of Programming".
Privacy
HTML CSS