# The problem of finding the first digit in Graham's number

Motivation

In this BBC video about infinity they mention Graham's number. In the second part, Graham mentions that "maybe no one will ever know what [the first] digit is". This made me think: Could it be possible to show that (under some assumptions about the speed of our computers) we can never determine the first digit?

In logic you have independence results like "We cannot decide if AC is true in ZF". But we cannot hope for this kind of result in this case, since we can easily program a computer to give us the answer. The problem is, that we don't have enough time to wait for the answer!

In complexity theory you prove things like "no program can solve all problems in this infinite set of problems, fast". But in this case you only have one problem, and it is easy to write a program, that gives you the answer. Just write a program that prints "1" another that prints "2" ... and a program that prints "9". Now you have a program that gives you the answer! The problem is, that you don't know which of the 9 programs that are correct.

Questions

1. Could it be possible to show that any proof of what the first digit in Grahams numbers is, would have length at least $10^{100}$?
2. Do there exist similar results? That is, do we know a decidable statement P and a proof that any proof or disproof of P must have length $10^{100}$.
3. Or can we prove, that any proof that a proof or disproof of P must have length at least $n$, must itself have length at least $n$?

I think the answer to 3) is no, at least if all proofs are in the same system. Such a proof would prove that it should have length all least n for any n.

(Old Questions:

1. Could it be possible to show that it would take a computer at least say $10^{100}$ steps to determine the first digit in Grahams number?
2. Do there exist similar results? That is, do we know a decidable statement P and a proof that P cannot be decided in less that say $10^{100}$ steps.
3. Or can we prove that we need at least $n$ steps to show that a decidable statement cannot be decided in less than $n$ steps?)

(I'm not sure I tagged correctly. Fell free to retag, or suggest better tags.)

• You need to be careful when you talk about complexity of a single problem. Perhaps it is not running time of a program but something like the length of a shortest formal proof (e.g. from ZFC). So if you write a program that just prints the answer, you must accompany it with a proof that the answer is correct, and the length of the proof counts in. – Sergei Ivanov Apr 8 '10 at 18:40
• Most likely, the answer is 1: wikiwand.com/en/Benford's_law. – stanm Jul 2 '15 at 11:38
• There's a 70% chance it's not $1$. – Todd Trimble Jul 2 '15 at 11:46
• There is either a 100% chance it's 1 or a 100% chance it's not 1, plus or minus 0%. – PrimeRibeyeDeal Jul 2 '15 at 13:49
• @stanm That is the strangest thing I have ever seen... – Simply Beautiful Art Aug 10 '16 at 0:27

Easy: 1. But you probably meant base 10, not base 3, right ? That's a touch harder...

[Hopefully I don't run afoul of some MO rule by injecting a little humour in an answer?]

• It is also 1 in base 2 and in base b with $Graham/2<b\leq Graham$. Yes, I was mostly interested in the case with 10 ;), but I think the answer would be interesting for any b, $3<b<\log(graham)$ not a power of 3. (I just choose $\log(graham)$ because it is a huge number much smaller than grahams numbers. You could probably have chosen a larger number) – Sune Jakobsen Apr 8 '10 at 20:01

It seems to me that the question is really about the shortest proof that the first digit of Graham's number is what it is, rather than the shortest program that calculates it. Indeed, if you have an efficient program plus a proof that the program is correct (which rules out your nine programs, one of which is correct), then you have a short proof, and if you have a short proof then you have an efficient program that you know is correct (it just prints out the answer).

There are certainly results that are known to be true in PA but only to have very long proofs in PA. For example, the proof that every Goodstein sequence eventually hits zero needs the axiom of infinity. But any particular instance can in principle be shown to hit zero -- it's just that the proof would take an inordinately long time. So the answer to your question 2 is yes if you restrict to PA. I imagine that similar results are known for other axiom systems. As Gerhard says, Harvey Friedman knows a lot about this sort of thing.

Harvey Friedman has dealt with many large numbers, as well as issues regarding their computability. (Cf. his Enormous Numbers in Real Life.) I suggest emailing him your question. (You can also check other Math Overflow posts on Graham's number.)

• I go to OSU, so if I see him around I will run it by him. – Steven Gubkin Apr 8 '10 at 18:33
• @Steven: I just sent him an email. It seems that OSUs math homepage is down. Do you know if the math.ohio-state.edu mails work? – Sune Jakobsen Apr 11 '10 at 17:07

In base nine it's 3.

• Citation, or details? – David Roberts Jun 26 '13 at 22:09
• @DavidRoberts Not the OP, but: since Graham's number is a power of 3, the first digit (mod 9) must be either 1 or 3. Since Graham's number is an odd power of 3 (it's 3 raised to another power of 3, all of which are odd), it has to be 3. – Steven Stadnicki Nov 27 '17 at 20:45

In general, the first digit of a number $A$ can be determined from the fractional part of $\log_{10} A$. Specifically, if $\log_{10} A = n + \gamma$ where $n = \lfloor \log_{10} A \rfloor$ and $\gamma = \{ \log_{10} A \}$ then $A = 10^\gamma 10^n$ and $1 \leq 10^\gamma < 10$. Therefore the first decimal digit of $A$ is $k$ iff $k \leq 10^\gamma < k+1$, or, equivalently, iff $\log_{10} k \leq \gamma < \log_{10} (k+1)$.

Taking the special case where $A = G$ is Graham's number, we have $G = 3^{3^x}$ for some natural number $x$. Then $\log_{10} G = 3^x \log_{10} 3$. Observe that multiplication by $3^x$ is the same as shifting the base 3 digits of a number $x$ places to the left. Setting $\alpha = \log_{10} 3$ the problem reduces to finding the base 3 digits of $\alpha$ starting $x$ places after the decimal point.

Then the following conjecture would imply that it is impossible to prove anything about the first digit of $G$ in time $o (x)$:

Conjecture: Given a natural number $x$ and a sequence of base 3 digits $z_0, \dots, z_{k-1}$, any proof in ZFC of the statement "The first $k$ base 3 digits of $\alpha$ starting $x$ places after the decimal point are not $z_0 \dots z_{k-1}$" must have length $\Omega\:(n)$.

Analogous conjectures can be asked for any other $b \geq 2$ and replacing $\alpha = \log_{10} 3$ with any other well-known irrational numbers. The reason to expect such a conjecture to hold is that I don't think there is any way to prove anything about $x$th digit of $\alpha$ that is essentially different from calculating the $x$th digit with a general-purpose algorithm, and I don't think there are any such sublinear general-purpose algorithms. Given that there does exist a quasilinear time algorithm for computing the digits of $\alpha$ (see Modern Computer Arithmetic for details), this conjecture would give a fairly sharp estimates $\tilde {\Theta}\:(\log \log G)$ steps for the shortest proof determining the first digit of $G$.

Showing that there are no sublinear-time algorithms for computing the $x$th digits of any natural irrational number seems more difficult than the P vs. NP problem, which is already far beyond what current theoretic computer science can achieve, and the conjecture I stated above is probably more difficult still. However, if we ever get to the point where it is possible to give sharp lower bounds on the most efficient possible algorithms for most problems, then this problem would be potentially solvable.

• I like this conjecture. Can you comment on the situation for $\alpha = \pi$ in light of the Bailey-Borwein-Plouffe formula? en.wikipedia.org/wiki/…? – Vincent Mar 18 at 12:10
• In general, if the most efficient algorithm for computing a few digits after the n'th digit requires $\Theta (f (n))$ "computational resources" then I expect a proof which constrains those digits should have length $\Theta (f (n))$, where the exact encoding method for proofs affects how the cost of a computation is calculated. A more efficient algorithm should lead us to expect weaker lower bounds for the proof length. Considering specifically $\alpha = \pi$ and $b = 2$, I believe the BPP algorithm requires $O (n \log n)$ time and $O (\log n)$ space, so I expect my conjecture to still be true. – Itai Bar-Natan Mar 18 at 14:29
• Yes, I expected the BPP to have $O(log n)$ time also since you don't need all previous digits, but somehow ruling out possible problems with 'carrying' takes up a LOT of time if I understand Wikipedia correctly. I still find it quite counterintuitive – Vincent Mar 18 at 21:03

Similarly, it is 1 if the base is of the shape $3^n$, with $n$ a power of 3 (less than $\ln G$) ; other cases are easy for small powers of 3. On the other hand, Graham's number is much too large for the question to be really interesting ; the determination of the first digit in base 10 of $A(9,9)$ (where $A$ is the Ackermann function) should already be inaccessible.

• Less than $\log_3 G,$ surely? – Charles May 8 '12 at 14:21
{"ft_lang_label":"__label__en","ft_lang_prob":0.9505629,"math_prob":0.9932125,"size":2244,"snap":"2019-51-2020-05","text_gpt3_token_len":524,"char_repetition_ratio":0.12321428,"word_repetition_ratio":0.121140145,"special_character_ratio":0.24643494,"punctuation_ratio":0.096359745,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.9991653,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2019-12-15T10:20:22Z\",\"WARC-Record-ID\":\"<urn:uuid:1146bcb3-6bb6-4bdf-865b-2171fb6276ae>\",\"Content-Length\":\"151148\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:5558c90a-abb0-4189-8e34-728b48f4f8d7>\",\"WARC-Concurrent-To\":\"<urn:uuid:4bec4d0e-44f5-45ad-a6ab-02f5f498ee53>\",\"WARC-IP-Address\":\"151.101.1.69\",\"WARC-Target-URI\":\"https://mathoverflow.net/questions/20765/the-problem-of-finding-the-first-digit-in-grahams-number/289627\",\"WARC-Payload-Digest\":\"sha1:F2JQRIMVCOMWHJSVIUA4CJJAA4F7U743\",\"WARC-Block-Digest\":\"sha1:ACGAOKVAR5TGRLI5HSCZMAM7OU5II2NU\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2019/CC-MAIN-2019-51/CC-MAIN-2019-51_segments_1575541307813.73_warc_CC-MAIN-20191215094447-20191215122447-00056.warc.gz\"}"}