The source code for bc can be obtained from any GNU site (for example, from ftp://gatekeeper.dec.com/pub/GNU/bc-1.04.tar.gz); it is very easy to compile and install. An excellent man page and some examples are included with the distribution. The examples include a program to calculate pi to a given number of digits, one to compute prime numbers and one to compute pairs of twin primes.