Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am wondering, what would happen to the representation of a number like 2 in base pi? I know that things like $π^2$ would simply be 100, but what about numbers that are not of the form $π^n$ ? I think it ought to get tricky!

share|cite|improve this question
Wouldn't $\pi^2=100$? $4=2^2=100$ in base 2 – Eleven-Eleven Feb 16 '14 at 17:37
Also I don't think our integers, base 10 could be represented in base $\pi$ since the integers are rational and $\pi^n, n \in \mathbb{Z}$ are irrational... – Eleven-Eleven Feb 16 '14 at 17:39
Yes Eleven-Eleven you are right! I will edit it. – Just_a_fool Feb 16 '14 at 17:42
Just a blind shot: 2 would be irrational in base π – Francisco Presencia Feb 17 '14 at 0:12

See here for formal definition of representation in a non integral base. With such a definition $2$ in base $\pi$ is simply... $2$. This because $2<\pi$ hence it can be represented by itself.

In any base $\beta$ most numbers (all but a countable set) have an infinite representation. Only sums of powers of $\beta$ have a finite representation.

Here is an algorithm (written in python) to compute the representation in any base:

from math import *
import string

def repr(x,b,digits=30):
    """ represent @x in base @b """
    DIGITS = string.digits + string.ascii_uppercase
    n = int(floor(log(x) / log(b)))
    r = ''
    while n>0 or (len(r)<digits and x != 0.0):
        d = int(x/b**n)
        if n==-1:
            r += '.'
        r += DIGITS[d]
        x = x - d * b**n
        n -= 1
    if r=='':
        r= DIGITS[0]
    return r

for x,b in [(1973.0,10), (8.0,2), (10.0,pi)]:
    print x, 'in base', b, 'is written:', repr(x,b)

The output is:

1973.0 in base 10 is written: 1973
8.0 in base 2 is written: 100
10.0 in base 3.14159265359 is written: 100.01022122221121122001111210
share|cite|improve this answer
Interesting, could I ask if changing the base has been used to solve a math problem that can't be solved in base 10 (or not easy to solve)? Thx. – NoChance Jan 7 at 5:15
I don't know. But here you find some references. – Emanuele Paolini Jan 7 at 5:21
Thanks for the link. – NoChance Jan 7 at 5:23

It's not enough to just say "base $\pi$" - the concept isn't really defined until you specify what the digits are allowed to be. What seems to me to be the only reasonable option is to say that digits can be anything within $[0,\pi)$, but this then makes representing anything trivial, because for any $a>0$, $$\Large \begin{align*} a&=\pi^{\log_\pi(a)}=\pi^{\lfloor\log_\pi(a)\rfloor}\underbrace{\pi^{\log_\pi(a)-\lfloor\log_\pi(a)\rfloor}}_{\text{between 0 and }\pi}\\\\\\ &=\pi^{\log_\pi(a)-\lfloor\log_\pi(a)\rfloor}\underbrace{00\ldots0}_{\lfloor\log_\pi(a)-1\rfloor}\text{ in base }\pi \end{align*}$$ So the representation of $2$ in base $\pi$ under this approach would just be $2$ (because $1<2<\pi$), while the representation of $4$ would be $\frac{4}{\pi}0$ (because $\pi<4<\pi^2$).

share|cite|improve this answer
You're right, when you take the concept to its logical conclusion it makes no sense at all! – TooTone Feb 16 '14 at 18:09

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.