# Digits of pi, base 16

1. Feb 25, 2012

### Redbelly98

Staff Emeritus
According to this link at Wolfram, the following formula can be used to calculate any digit of the base-16 representation of π:

$$\pi = \sum_{n=0}^{\infty} \ \left( \frac{4}{8n+1} - \frac{2}{8n+4} - \frac{1}{8n+5} - \frac{1}{8n+6} \right) \cdot \frac{1}{16^n}$$

But apparently it is not as straightforward as simply taking the nth term in the series to get the nth digit. For example, the 0th term is 3.1333..., and not simply 3 as it must be.

So my question is, just how does one use this formula to calculate a digit? Or am I missing something in my above reasoning?

2. Feb 25, 2012

### morphism

The problem is that the expression between brackets isn't an integer between 0 and 15, so it's not going to give you the nth digit. You're going to have to deal with fractional and integral parts and do some cleaning up before you actually get the nth digit to pop out. You can read up on how to do this here. This is something that's not so easily done by hand, but very easily done by a computer program.

3. Feb 25, 2012

### Redbelly98

Staff Emeritus
Ah, thanks.

For the most part I'll have to be satisfied with "it's not so simple", but now I have a better appreciation and some sense of how it can be done.

Thanks again!