The Algorithm Design Manual
About the Book
Programming Challenges

The Stony Brook Algorithm Repository

Steven Skiena
Stony Brook University
Dept. of Computer Science

PARI - Package for Number Theory

PARI is a system capable of handling complex number-theoretic and algebraic problems. The predefined types are integers (up to 300000 decimal digits), reals (same for the relative precision), elements of Z/nZ, rational numbers, complex numbers, p-adic numbers, quadratic numbers, polynomials, power series, algebraic extensions, rational functions, binary quadratic forms, vectors, matrices.

More than 200 special predefined functions, arithmetic or transcendental, are implemented, in addition to the usual arithmetic operations, which can be used without paying attention to the type of the object. The source uses more than 32000 lines of code, mainly in C.

PARI can be used as a library, but possesses also a powerful calculator mode which gives instant access to all the types and functions. In this mode, one can write programs with a simple syntax a little similar to C, but taking also LISP-like constructs.

The main advantage of PARI is its speed. On a Unix platform, it is between 5 to 100 times faster than Maple or Mathematica, depending on the applications. Also it is specially tailored for use by number theorists, hence contains a large number of predefined number-theoretical functions not found in other systems. It can of course profitably be used by other people as well. Finally, it is free.

Currently, PARI is available for PC, Amiga, Macintosh, and most Unix platforms by anonymous ftp at in the directory pub/pari. The current version of PARI is 1.39 (Jan. 1995).

The email address of the PARI group is

  • Download Files (local site)
  • Pari Home Page
  • Pari Download Page

    Problem Links

    Arbitrary Precision Arithmetic (9)
    Factoring and Primality Testing (6)

    This page last modified on 2008-07-10 .