37
8
Write the shortest possible program (length measured in bytes) satisfying the following requirements:
- no input
- output is to stdout
- execution eventually terminates
- total number of output bytes exceeds Graham's number
Assume that programs run until "normal" termination on an ideal computer1 able to access unlimited resources, and that the common programming languages are modified if necessary (without changing the syntax) to allow this. Because of these assumptions, we might call this a kind of Gedankenexperiment.
To get things started, here's a 73-byte Ruby program that computes fω+1(99) in the fast-growing hierarchy:
f=proc{|k,n|k>0?n.times{n=f[k-1,n]}:n+=1;n};n=99;n.times{n=f[n,n]};puts n
1 EDIT: More precisely, suppose we're taking an existing system and modifying it only to have no upper limit on storage size (but it is always finite). The execution-times of instructions are not supposed to be modified, but the machine is assumed to be ideal in that it will have no upper limit on its operating lifetime.
This takes my tetration question to a whole new level!
– MrZander – 2012-06-25T03:47:07.1901
There was once a similar programming contest called the Bignum Bakeoff. Some of the entries are quite interesting; the results are here: http://djm.cc/bignum-results.txt
– Danny Chia – 2013-06-09T19:01:34.973