Your goal is to write a program that prints a number. The bigger the number, the more points you'll get. But be careful! Code length is both limited and heavily weighted in the scoring function. Your printed number will be divided by the cube of the number of bytes you used for your solution.

So, let's say you printed 10000000 and your code is 100 bytes long. Your final score will be \$\frac {10000000} {100^3} = 10\$.

There are other rules to follow, in order to make this challenge a bit harder.

  • You cannot use digits in your code (0123456789);
  • You can use mathematical/physical/etc. constants, but only if they are less than 10. (e.g. You can use \$\pi \approx 3.14\$ but you can't use the Avogadro constant \$= 6\times 10^{23}\$)
  • Recursion is allowed but the generated number needs to be finite (so infinite is not accepted as a solution. Your program needs to terminate correctly, assuming unbounded time and memory, and generate the requested output);
  • You cannot use the operations * (multiply), / (divide), ^ (power) nor any other way to indicate them (e.g. 2 div 2 is not allowed);
  • Your program can output more than one number, if you need it to do that. Only the highest one will count for scoring;
  • However, you can concatenate strings: this means that any sequence of adjacent digits will be considered as a single number;
  • Your code will be run as-is. This means that the end-user cannot edit any line of code, nor he can input a number or anything else;
  • Maximum code length is 100 bytes.


  1. Steven H., Pyth \$\approx f_{\varphi(1,0,0)+7}(256^{26})\$
  2. Simply Beautiful Art, Ruby \$\approx f_{\varphi(1,0,0)}(3)\$
  3. Peter Taylor, GolfScript \$\approx f_{\varepsilon_0+\omega+1}(17)\$
  4. r.e.s., GolfScript \$\approx f_{\epsilon_0}^9(126)\approx f_{\epsilon_0+1}(9)\$ [1]
  5. Simply Beautiful Art, Ruby \$\approx f_{\omega^{\omega2}+1}(126^22^{126})\$
  6. eaglgenes101, Julia \$\approx f_{\omega^3}(127)\$
  7. col6y, Python 3, \$\approx 127\to126\to\dots\to2\to1\approx f_{\omega^2}(127)\$ [1][3]
  8. Toeofdoom, Haskell, \$\approx a_{20}(1)\approx f_{\omega+1}(18)\$ [1]
  9. Fraxtil, dc, \$\approx 15\uparrow^{166665}15\$ [3]
  10. Magenta, Python, \$\approx\mathrm{ack}(126,126)\approx10\uparrow^{124}129\$
  11. Kendall Frey, ECMAScript 6, \$\approx1000\uparrow^43\$ [1]
  12. Ilmari Karonen, GolfScript, \$\approx10\uparrow^310^{377}\$ [1]
  13. Aiden4, Rust, \$\approx10\uparrow^3127\$
  14. BlackCap, Haskell, \$\approx10\uparrow\uparrow65503\$
  15. recursive, Python, \$\approx2\uparrow\uparrow11\approx10\uparrow\uparrow8.63297\$ [1][3]
  16. n.m., Haskell, \$\approx2\uparrow\uparrow7\approx10\uparrow\uparrow4.63297\$ [1]
  17. David Yaw, C, \$\approx10^{10^{4\times10^{22}}}\approx10\uparrow\uparrow4.11821\$ [2]
  18. primo, Perl, \$\approx10^{(12750684161!)^{5\times2^{27}}}\approx10\uparrow\uparrow4.11369\$
  19. Art, C, \$\approx10^{10^{2\times10^6}}\approx10\uparrow\uparrow3.80587\$
  20. Robert Sørlie, x86, \$\approx10^{2^{2^{19}+32}}\approx10\uparrow\uparrow3.71585\$
  21. Tobia, APL, \$\approx10^{10^{353}}\approx10\uparrow\uparrow3.40616\$
  22. Darren Stone, C, \$\approx10^{10^{97.61735}}\approx10\uparrow\uparrow3.29875\$
  23. ecksemmess, C, \$\approx10^{2^{320}}\approx10\uparrow\uparrow3.29749\$
  24. Adam Speight, vb.net, \$\approx10^{5000\times2^{256}}\approx10\uparrow\uparrow3.28039\$
  25. Joshua, bash, \$\approx10^{10^{15}}\approx10\uparrow\uparrow3.07282\$


  1. If every electron in the universe were a qubit, and every superposition thereof could be gainfully used to store information (which, as long as you don't actually need to know what's being stored is theoretically possible), this program requires more memory than could possibly exist, and therefore cannot be run - now, or at any conceiveable point in the future. If the author intended to print a value larger than ≈10↑↑3.26 all at once, this condition applies.
  2. This program requires more memory than currently exists, but not so much that it couldn't theoretically be stored on a meager number of qubits, and therefore a computer may one day exist which could run this program.
  3. All interpreters currently available issue a runtime error, or the program otherwise fails to execute as the author intended.
  4. Running this program will cause irreparable damage to your system.

Edit @primo: I've updated a portion of the scoreboard using a hopefully easier to compare notation, with decimals to denote the logarithmic distance to the next higher power. For example \$10↑↑2.5 = 10^{10^{\sqrt {10}}}\$. I've also changed some scores if I believed to user's analysis to be faulty, feel free to dispute any of these.

Explanation of this notation:

If \$0 \le b \lt 1\$, then \$a \uparrow\uparrow b = a^b\$.

If \$b \ge 1\$, then \$a \uparrow\uparrow b = a^{a \uparrow\uparrow (b-1)}\$.

If \$b \lt 0\$, then \$a \uparrow\uparrow b = \log_a(a \uparrow\uparrow (b+1))\$

An implementation of this notation is provided in Python that let's you test reasonably sized values.

  • 23
    \$\begingroup\$ Has someone explicitly said "base 10" yet? \$\endgroup\$
    – keshlam
    Commented Jan 9, 2014 at 14:42
  • 2
    \$\begingroup\$ Does the large number count if it's say 12e10 (12*10^10) as 12*10^10? \$\endgroup\$
    – hichris123
    Commented Jan 9, 2014 at 19:36
  • 6
    \$\begingroup\$ I think a better constraint instead of forbidding *, /, and ^, would've been to allow only linear operations, e.g. +, -, ++, --, +=, -=, etc. Otherwise, coders can take advantage of Knuth's up-arrow/Ackermann library functions if made available in their language of choice, which seems like cheating. \$\endgroup\$ Commented Jan 10, 2014 at 0:19
  • 25
    \$\begingroup\$ I'm still waiting to see someone earn footnote [4]. \$\endgroup\$ Commented May 18, 2017 at 15:41
  • 8
    \$\begingroup\$ Is a zero-byte program valid? \$\endgroup\$
    – pxeger
    Commented Oct 21, 2021 at 15:43

95 Answers 95


Pyth, \$>\operatorname{Laver}^{\operatorname{Laver}^{\operatorname{Laver}^{\operatorname{Laver}^{\operatorname{Laver}^{131072}(131072)}(131072)}(131072)}(131072)}(131072)/87^3\$


Original Python:

def laver(size, x, y):
  if y % size == 0: return (x + 1) % size
  return laver(size, laver(size, x, y - 1), y + 1)
def next(period):
  i = 1
  while laver(i, 0, period): i += i
accumulator = 131072
for i in range(accumulator):
  for j in range(accumulator):
    for k in range(accumulator):
      for l in range(accumulator):
        for m in range(accumulator):
          accumulator = laver(accumulator)

How it works

This entry is based off of Laver tables. A Laver table of order \$n\$ (or size \$2^n\$) is a binary operation on integers from 1 to \$2^n\$ such that: $$x\star 1=x+1(\mathrm{mod}\ 2^n)$$ $$x\star(y\star z)=(x\star y)\star(x\star z)$$ The laver(size, x, y) function recursively computes the Laver table of size size (who could've expected?), except I used the numbers from 0 to \$2^n-1\$, because all programmers do it, and I can just do the modular reduction without having to set the result to size if it turns out to be 0. The recursive call doesn't reduce the last argument, but checking the base case does, so the function ends up being periodic in the last argument. There has to be a modular reduction in one place, so this is unavoidable.

The next function computes the next Laver table size with a given period. Every Laver table has a period, defined as the period of \$1\star n\$. The period is clearly always a power of 2, and it grows extremely slowly. Thus, the size needed to reach a given period grows extremely rapidly (the size needed for period 32 is unknown, see next paragraph). This function I denoted \$\operatorname{Laver}\$ in the title.

In fact, it is unknown if the periods grow infinitely. If they didn't, this number would be ill-defined. I usually don't like submitting ill-defined numbers, but there are reasons I believe this number is well-defined.

  1. It is provable in \$ZFC+I3\$.
  2. It is almost certainly provable in a weaker system, see below.

Notes on the strength of Laver tables

It is a common practice that somehow works, to assign growth rates to a function based off of the strength of a theory proving it total. Consider the minimal theories that prove "the periods of Laver tables are unbounded," which is an arithmetic statement, especially the "Big Five":

  1. \$RCA_0,WKL_0\$ have strength \$\omega^\omega\$. It seems unlikely that they could prove the laver tables are unbounded, given that all proofs use set theory, which these can't encode much of. If this is the strength, then this entry would place at #6.
  2. \$ACA_0\$ has strength \$\varepsilon_0\$. This is the weakest that could plausibly prove the Laver tables are unbounded. Being conservative over \$PA\$, this seems unlikely. At this strength, this entry would place at #5.
  3. \$ATR_0\$ has strength \$\Gamma_0\$. At this level of strength, this entry is already at #2.
  4. The next subsystem, \$\Pi^1_1\text{-}CA\$ already makes this entry the first by a massive margin. It also stands a much more reasonable chance of actually proving the Laver tables unbounded. Even if merely \$KP\$ was sufficient, this would still utterly dominate the other entries.

What if it's stronger?

Consider the usual explanation of how large cardinals are connected with Laver tables:

A rank is a set \$R\$ such that \$f:R\mapsto R\implies f\in R\$. Assume there is a set with a non-trivial elementary embedding from \$i:S\mapsto S\$, then there is a rank \$R\$ with the same property. Take another embedding \$j\$, then \$i(j)\$ is an embedding because being an embedding is definable. Consider \$i(j(k))\$. \$j(k)\$ is the image of \$k\$ under \$j\$, and being the image is definable, so \$i(j(k))=i(j)(i(k))\$. If we let \$i\star j=i(j)\$ then this is one of the defining relationships of a Laver table.

It seems to be possible to implement this in an extension of \$KP\$, and as this seems to be the most natural way to arrive at Laver tables, this might give the proper estimate of its strength. One example is to define a rank-into-rank set as a set \$S\$ that contains an embedding \$j:S\mapsto S\$ (which using replacement, ensures the existence of many other embeddings in \$S\$). The embedding \$j\$ should be such that all \$\Sigma_1\$ (or maybe \$\Pi_2\$) statements in \$(S,\in,\mathfrak{F},\mathfrak{I})\$, where \$\mathfrak{F},\mathfrak{I}\$ are unary and ternary predicates for being an embedding, and being the image under an embedding, respectively. If this is consistent, then it could give a better strength estimate.


Python 3: 98 chars, ≈ 10 ↑↑ 256

Using a variable-argument function:

E=lambda n,*C:E(*([~-n][:n]+[int("%d%d"%(k,k))for k in C]))if C else n;print(E(*range(ord('~'))))

Effectively, E decrements the first argument while increasing the rest of the arguments, except that instead of putting -1 in the arguments it drops the argument. Since every cycle either decrements the first argument or decreases the number of arguments, this is guaranteed to terminate. The increasing function used is int("%d%d"%(k,k)), which gives a result between k**2 + 2*k and 10*k**2 + k. My code does use the * symbol - but not as multiplication. It's used to work with variable numbers of arguments, which I think should follow the rules since the clear point of the rules was to restrict specific operations, not the symbols themselves.

Some examples of how large E gets quickly:

E(1,1) = 1111
E(0,1,1) = E(11,11) = (approx) 10^8191
E(1,1,1) = E(1111,1111) = (approx) 10^(10^335)
E(2,1,1) = E(11111111,11111111) = (approx) 10^(10^3344779)

Only the first two of those are runnable on my computer in a reasonable amount of time.

Then, E is invoked by E(*range(ord('~'))) - which means:

E(0,1,2,3,4,5, ... ,121,122,123,124,125)

I'm not entirely sure how large this is (I've been trying to approximate it to no avail) - but it's obvious that it's ~really~ big.

As an example, about twelve cycles in, the result is around: (technically a bit more than)


Result estimation:

If we approximate the increasing step by lambda k: 10 * k**2, the function can be described as

E(n, C₁, C₂, ... Cᵥ) ≈ E(10^(n²/2) ⋅ C₁²ⁿ, 10^(n²/2) ⋅ C₂²ⁿ, ... 10^(n²/2) ⋅ Cᵥ²ⁿ)
                     ≈ E(10^((10^(n²/2) ⋅ C₁²ⁿ)²/2) ⋅ C₂^(2n  ⋅ 10^(n²/2) ⋅ C₁²ⁿ), ... )
                     ≈ E(10^((10^n² ⋅ C₁⁴ⁿ)/2) ⋅ C₂^(2n  ⋅ 10^(n²/2) ⋅ C₁²ⁿ), ... )

The relevant thing we're doing here is build up a tower of powers of ten, so the eventual score can be approximated as 10 ↑↑ 256.

Better (although partial) result estimation:

This uses the same 10 * k**2 as the other estimation.

E(0, b) = 10 * b**2
E(1, b) = 10 * (10 * b**2)**2 = 10 * 100 * b**4 = 10**3 * b**4
E(2, b) = 10 * (10**3 * b**4)**2 = 10 * (10**6 * b**8) = 10**7 * b**8
E(a, b) = 10**(2**(a+1)-1) * b**(2**(a+1))

Under the previous estimation, it would be:

E(a, b) = 10**(a**2/a) * b**(2*a)

Which is significantly smaller than the actual value since it uses a**2 instead of 2**a for the 10 and uses a*2 instead of 2**a for the b.

  • \$\begingroup\$ I estimated your result, feel free to disagree. \$\endgroup\$ Commented Jan 12, 2014 at 14:26
  • \$\begingroup\$ I have to disagree with that result. One moment while I type out my reasoning. \$\endgroup\$
    – Cel Skeggs
    Commented Jan 12, 2014 at 20:18
  • \$\begingroup\$ There we go. As I said in the update, your estimation appears to be significantly smaller than the actual value. \$\endgroup\$
    – Cel Skeggs
    Commented Jan 12, 2014 at 20:25
  • \$\begingroup\$ Fair enough, but at any rate we need a recursive-inductive / at-once estimation, not just a single step, to include this answer in the scoring list. I'm certain your score is better than recursive's, but also pretty sure not better than Ilmari Karonen's (which is very extendable anyway, using only 18 characters at the moment), so I think my estimation is good enough for the scoring purpose. \$\endgroup\$ Commented Jan 12, 2014 at 20:27
  • \$\begingroup\$ I agree. I'll see if I can work more at it and at least come up with a more accurate lower bound for the result. \$\endgroup\$
    – Cel Skeggs
    Commented Jan 12, 2014 at 20:29

C (score ≈ 10^20 000 000 000 ≈ 10↑↑3.005558275)

  • ~20 GB output
  • 41 characters (41^3 means nothing)

Despite of rand() the output is deterministic because there is no seed function.

  • \$\begingroup\$ If you are unlucky then your program stops after one iteration and the call for rand() as terminating condition makes it non deterministic. Furthermore calling rand() in every iteration should make it terribly slow. Use something like LONG_MAX defined in limits.h instead. \$\endgroup\$
    – klingt.net
    Commented Jan 9, 2014 at 11:24
  • \$\begingroup\$ Ok i take the non deterministic back, because there is no seed like you wrote. \$\endgroup\$
    – klingt.net
    Commented Jan 9, 2014 at 11:35
  • 1
    \$\begingroup\$ How about ~' ' instead of rand(), printed with %u ? Two bytes less source, and a higher value. \$\endgroup\$
    – MSalters
    Commented Jan 10, 2014 at 9:30

brainfuck, 97 bytes, f255(2552)


Assumes a wrapping implementation with an infinite tape in both directions.

The algorithm of the program is:

Initialise a list with 255^2+1 255s
While the list exists:
    Print a 3
    Pop the first element of the list to use as a counter
    Decrement the counter
    Append counter many 1s to the end of the list
    While counter != 0:
        Prepend length of list-1 copies of the counter to the front of the list
        Decrement counter

This is not infinite, as every time a list element is processed, it only appends elements that are less than it. 1s are popped and removed without appending anything.

A step by step explanation of the code:

- Initialise counter as 255
[ While counter
  >-[[>]-[<]>>-] Add 255 255s to the list
  <- Decrement counter
This initialises the list as 255^2+1 255s

[ While list exists
  - Decrement the first element
    [>]+[<] Append that many 1s to the end of the list
    <+>>-   Copy the element one over
  -[<+>-----]<.,< Print a 3
  [ While counter
      >>> Go to first element of list
      [ For each element in the list
          [-<+>] Move the element over one
          <[<]< Go to the counter
          [->+<<+>] Prepend a copy of the counter to the start of the list
          >[>]> Go to the next element of the list
      <+[<] Return to the start of the list while appending a 1
      >,    Remove the first element of the list
      <<-   Decrement the counter
  >>> Go to first element of the list

Big thanks to the folks on the Ordinal Studies Discord for helping me understand just how big the number is. If anything seems wrong, blame them please correct me.


Julia, fω3(127)


I aimed for the fast-growing functions corresponding to ordinals in the Veblen hierarchy, but I had to settle for ordinal exponentation. Maybe another challenge...


#Function iteration, which is the tool to get us this far
#Applies s to r, t times

#Here's the first order successor:

#Function to help us with diagonalization
#Take a and x, and fold the b higher order function on the a function x times, 
#then plug x into the resulting function
#Doing this multiplies the ordinal position by ω, which isn't nearly as high as I would hope
#Yes,I tried the ~ operator, but Julia doesn't like when I do that

#Call it, and implicitly return it. 
#Or interrupt it, and and enjoy your screenfulls of stack traces. 
  • \$\begingroup\$ Could you ungolf it? Can't help you approximate your number if I can't understand it. \$\endgroup\$ Commented Nov 1, 2017 at 11:41
  • \$\begingroup\$ Alright, presented an ungolfed explanation for estimation purposes. \$\endgroup\$ Commented Nov 1, 2017 at 12:51
  • 1
    \$\begingroup\$ As per the not copy/pasting into stackexchange properly, save it on a RIO link or something like that and make mention of it. \$\endgroup\$ Commented Nov 1, 2017 at 13:02
  • \$\begingroup\$ Your score is between f<sub>ω+2</sub>(15) And f<sub>ω+2</sub>(16). Closer to the 15 than the 16. \$\endgroup\$ Commented Nov 1, 2017 at 13:05
  • 1
    \$\begingroup\$ Good luck then! \$\endgroup\$ Commented Jul 4, 2018 at 21:39

Rust, score \$10 \uparrow\uparrow\uparrow 127\$

fn main(){let b='~' as usize;let mut n=b+b;for _ in b..n{n<<=n;for _ in b..n{n<<=n;print!("{}",n)}}}

Try it online!

Note that the code's validity is dependent on the assumption that a computer with infinite memory will have an arbitrary precision pointer to index the infinite memory. I also attempted to write a version that wouldn't overflow instantly with arbitrary precision integers but it still overflowed on the second bitshift.

Size analysis:

A bit-shifting \$n\$ leftward \$n\$ times is equivalent to the function \$n2^n = f_2(n)\$. My code applies recursion in a manner consistent with the fast-growing hierarchy to achieve \$f_4(n)\$. let the final value of the local variable n in my code above be denoted as \$o\$. It will require \$log(o)\$ bitshifts to create \$o\$. The print! statement runs every time the inner bitshift does, meaning the order of magnitude of my score is the sum of the change in the order of magnitude of the variable n between the inner bitshifts. The order of magnitude of n should be growing exponentially since it is being tetrated, so the expression for the order of magnitude of the result is $$\sum_i^{log(o)}2^i$$ telling us that the final number is \$10^{2^{log(o)+1}-1}\$ which is not meaningfully different from \$o\$ itself since \$o\$ in this case is \$f_4(126)\$ or \$10 \uparrow\uparrow\uparrow 127\$. Please let me know if this explanation seems wrong or incomplete because I am new to the domain of big numbers.

Edit: better approximation thanks to Simply Beautiful Art.

  • 1
    \$\begingroup\$ In accordance with this, you may lower bound with$$f_4(126)\ge10\uparrow\uparrow\uparrow127.$$(Keeping it base 10 for simplicity of comparison.) \$\endgroup\$ Commented May 21, 2021 at 22:57

C (clang), 0 bytes, score \$\frac{86}{0}\$

Try it online!


/usr/bin/ld: /usr/bin/../lib/gcc/x86_64-redhat-linux/8/../../../../lib64/crt1.o: in function `_start':
(.text+0x24): undefined reference to `main'
clang-7: error: linker command failed with exit code 1 (use -v to see invocation)
/srv/wrappers/c-clang: line 5: ./.bin.tio: No such file or directory


No idea how to score this :P


Japt, 47 bytes, BMS[26] ~ fPTO(Z2)(26)

Code snippet


This is probably the largest number ever posted on this site that is less than Loader's Number. We utilize the Bashicu Matrix System, which is a ridiculously powerful notation that is proven to terminate, but whose strength is unknown. We know BMS is at least as strong as collapsing inaccessible cardinals with respect to standard fundamental sequences, though that was an understatement. BMS is conjectured to reach the limit of second order arithmetic.

In all of its full glory, here is the code. I could probably optimize this more (idk what to do with the other 50 bytes) or port this to a more familiar language. If you want to copy me, you are free to do so, but credit me:

;T°?UÊ?ßUcUsX=Uo)m_<X-X%BÊ?Z:Z+UÊ-X:T:ßBÊo cBÊo

Try it here!

The rest of this post will first show what BMS is, and how it is so strong. Then, we introduce Flattened Address Matric System (FAMS) and how it is another representation of BMS. Finally, we analyze the program part and show how this program calculates BMS.


What is BMS anyways?

Now although I could start listing expansion rules, I figured the resources above do a better job showing the power of BMS. Thus, I would focus more on the structuring on BMS.

The Bashicu Matrix System is a system of matrices with an expansion rule, causing these matrices to behave similar to ordinals. They are lexicographically ordered, and there are many subsystems: PrSS which is 1-row BMS, PSS which is 2-row BMS, TSS which is 3-row BMS, and so on.

We represent a BMS matrix like this: (a,b,c)(d,e,f)(g,h,j)(k,l,m),... which corresponds to 3-row BMS, though extra rows are possible. Each 3-tuple corresponds to a BMS column. Moreover, each element/number has exactly one parent corresponding to its row level within its column. Thus, try to think of BMS as multitrees or a direct acyclic graph; that is trees that are layered on top of each other, and each column having a level 1 parent, a level 2 parent, and so on.

It could be possible that a parent does not exist for a particular level within a column. This is usually represented in BMS by a zero, or a self-address in FAMS. Let me show an example. A multitree associated with (0,0,0)(1,1,1)(2,1,0)(3,1,0)

Here, you can see Level 1 parents in black connections, the Level 2 parents in red connections, and the Level 3 parents in blue connections.

Now here is the neat part: when expanding a BMS matrix, all of the parent-child relationships are preserved except possibly the rightmost node. Read the resources above more to understand BMS more.

Introducing FAMS

We can make BMS easier to understand by replacing each element with an address of its parent (i.e. what column its parent refers to). Parent addresses are always smaller than their children. Some elements may not have parents; in that case we let those elements be their own parents (so we have a self-referential address). This notation is called AMS, or Address Matrix System.

To go from AMS to FAMS, we flatten the entire matrix, so (a,b,c)(d,e,f)(g,h,i),... becomes {3}[a,b,c,d,e,f,g,h,i,...], where the {3} indicates that there are three rows.

FAMS has a few more simplifications - mainly that trailing zeroes in BMS, or trailing self-references in FAMS, are omitted.

Some examples of BMS matrices and their correspondence to FAMS:

  • (0,0)(1,1) = {2}[0,1,0,1]
  • (0,0)(1,1)(2,0) = {2}[0,1,0,1,2]
  • (0,0)(1,1)(2,0)(1,1) = {2}[0,1,0,1,2,5,0,1]
  • (0,0)(1,1)(2,1)(0,0)(1,0) = {2}[0,1,0,1,2,3,6,7,6]
  • (0,0,0)(1,1,0)(2,2,0) = {3}[0,1,2,0,1,5,3,4]
  • (0,0,0)(1,1,1) = {3}[0,1,2,0,1,2]

Here is code converting between FAMS and BMS

function FAMS_to_BMS(arr,rows) {
    for (let i=0;i<arr.length;i++) { //loop over all
    // Initialize the resulting array of blocks
    let result = [];
    // Loop through the array in steps of 'size'
    for (let i = 0; i < arr.length; i += rows) {
        // Extract a block of 'size' elements
        let block = arr.slice(i, i + rows);
        // If the block is smaller than the desired size, pad it with zeroes
        while (block.length < rows) {
        // Add the block to the result array
    return result;

function parent(matrix,row,col) { //returns column that is a parent
    if (row==-1) {
        return col-1
    let c = col
    let element = matrix[col][row]
    while(c >= 0 && matrix[c][row]>=element) {
        c = parent(matrix,row-1,c)
    return c >= 0 ? c : -1 // cannot find

function BMS_to_FAMS(matrix,rows) {
    arr = []
    for (let i=0;i<matrix.length;i++) {
        for(j=0;j<rows;j++) {
            let p = parent(matrix,j,i)
    while (arr[arr.length-1]==arr.length-1) {
    return arr

More importantly, expansion in FAMS is ridiculously easy:

function Expand(matrix,rows,amount) {
    child = matrix.pop()
    ascension = matrix.length - child 
    pre_expand = Array(amount).map((x,y)=>y+1) //array 1,2...amount
    append = pre_expand.flatMap(q=>
    return matrix.concat(append)

In the code below, you would find out that we expand with q=1. This actually corresponds to the Slow Growing Hierarchy, with base equal to 2. It turns out that this expansion is nondegenerate starting from [0,1,2,...,n,0,1,2,...,n], since at each non-successor step we remove 1 element and add a (multiple of number of rows) number of elements. Another possible concern is that SGH is much weaker than the FGH, though there are "catching points" where SGH has similar strength to the FGH. The first catching point starts at ψ(Ωω), but BMS goes waaaaaaay beyond that.


This is best done by converting to ungolfed JavaScript.

ALPHABET = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"                   // ; (built-in, variable B)
rows = 26                                                 // BÊ (our "constant", we just take length of alphabet)
T = 0                                                     // (implicit start)
matrix = Array(rows).fill("").map((x,y)=>y)               // BÊo (creates 0,1,2,...,25 array)
matrix = matrix.concat(matrix)                            // cBÊo (duplicates array)
while (matrix.length) {                                   // ß (run program again loop)
    child = matrix.pop()                                  // X=Uo  (sets child)
    ascension = matrix.length - child                     // UÊ-X (sets ascension)
    matrix = matrix.concat(matrix.slice(child)            // UcUsX=Uo)
        .map(x=>x>=child-child%rows?x+ascension:x))       // m_<X-X%BÊ?Z:Z+UÊ-X
    T++                                                   // T°
alert(T)               //implicit Japt output, using Japt st:out

Immediately, one sees that this program does not implement Bashicu Matrix System, but rather Flattened Address Matrix System (FAMS), which is equivalent to BMS. In FAMS, there is a constant which denotes the number of rows (rows=26 here), which means that every 26 entries form a single column. Each entry is an address that refers to the 0-index of its parent, though some entries have no parents, in which their addresses refers to themselves.

The large number in this post is {26}(0,1,2,3,...,25;0,1,2,3,...,25), which corresponds to (0,0,...,0,0)(1,1,...,1,1) in BMS. This number is massive. To really understand the size of this number, we need to compare BMS with known ordinal correspondences.

Size Comparison

  • (0) corresponds to ordinal 1
  • (0)(0) corresponds to ordinal 2
  • (0)(1) corresponds to ordinal ω
  • (0)(1)(0)(1) corresponds to ordinal ω2, beating Graham's Number
  • (0)(1)(1) corresponds to ordinal ω2
  • (0)(1)(1)(1) corresponds to ordinal ω3
  • (0)(1)(2) corresponds to ordinal ωω
  • (0)(1)(2)(3) corresponds to ordinal ωωω
  • (0,0)(1,1) corresponds to ordinal φ(1,0)
  • (0,0)(1,1)(1,0)(2,1) corresponds to ordinal φ(1,0)^2
  • (0,0)(1,1)(1,1) corresponds to ordinal φ(1,1)
  • (0,0)(1,1)(2,0) corresponds to ordinal φ(1,ω)
  • (0,0)(1,1)(2,1) corresponds to ordinal φ(2,0)
  • (0,0)(1,1)(2,1)(2,1) corresponds to ordinal φ(3,0)
  • (0,0)(1,1)(2,1)(3,0) corresponds to ordinal φ(ω,0)
  • (0,0)(1,1)(2,1)(3,1) corresponds to ordinal φ(1,0,0)
  • (0,0)(1,1)(2,1)(3,1)(4,0) corresponds to the Small Veblen Ordinal, beating all other entries on this list
  • (0,0)(1,1)(2,1)(3,1)(4,1) corresponds to the Large Veblen Ordinal, beating TREE(3)
  • (0,0)(1,1)(2,2) corresponds to the Bachmann-Howard Ordinal
  • (0,0)(1,1)(2,2)(3,3) corresponds to ψ(Ω3), collapsing Extended Buchholz OCF
  • (0,0,0)(1,1,1) corresponds to ψ(Ωω); the limit of the Π1-CA0 subsystem of Z2 and also the first Catching ordinal
  • (0,0,0)(1,1,1)(2,1,0) corresponds to ψ(Ωω*Ω)
  • (0,0,0)(1,1,1)(2,1,0)(1,1,1) corresponds to ψ(Ωω^2), which is the first time BMS really takes off
  • (0,0,0)(1,1,1)(2,1,1)(3,1,0)(2,0,0) corresponds to ψ(ψI(0))
  • (0,0,0)(1,1,1)(2,1,1)(3,1,1) corresponds to ψ(ψIω(0)) ...
  • (0,0,0)(1,1,1)(2,2,1)(3,0,0) corresponds to the limit of Strong Array Notation ...
  • (0,0,0)(1,1,1)(2,2,2) is expected to correspond to the limit of Π2-CA0 subsystem of Z2
  • (0,0,0,0,0,...)(1,1,1,1,1,...) is expected to correspond to the limit of Z2


The Bashicu Matrix System is known to be very powerful. Analysis of BMS is still a very active field in Googology, and there are a few extensions (such as the Y-sequence). This BMS number is smaller than Loader's Number, since BMS is bounded above by the limit of second order arithmetic.
  • \$\begingroup\$ These look like 47 Unicode characters rather than ASCII characters. Word count (wc) reports 56 bytes. \$\endgroup\$
    – John Tromp
    Commented Jun 14 at 8:34

Ruby, 94 characters, Friedman's n[26]

b,e=%w[aa zz]
p(b=~/$/)while t=t.product([*b<<?a..e<<?z]).reject!{|*o,n|n[/#{o*'|'}/]}

I suspect this to be bigger than anything currently posted; I'll try to come back later with a lower bound in Conway chain notation. This code constructs all possible trees of words using the 26-letter alphabet in which the root node is a two-letter word, each child contains one more letter than its parent, and no later node contains an earlier node as a substring. It does this via dumb brute force which means it pegs my computer trying to calculate n[2] (which should be 11). It does get n[1] right, at least, and the code looks right to me. See the linked paper for proof that this terminates. At each step it prints the size of the largest leaf (by current rules the last and largest number it prints counts as the answer).

  • \$\begingroup\$ "... as a substring" -- Careful, Friedman's n() function concerns subsequences, not substrings. Unfortunately, I can't read your code well enough to know which you're using. \$\endgroup\$
    – r.e.s.
    Commented Jan 19, 2014 at 19:47
  • \$\begingroup\$ You're right, I'd misread. No proof that this actually terminates, then. \$\endgroup\$
    – histocrat
    Commented Jan 19, 2014 at 20:46
  • \$\begingroup\$ Actually, if I remember correctly, the case of substrings can be proved non-terminating (i.e., the sequence can be made arbitrarily long without embedding any substrings). \$\endgroup\$
    – r.e.s.
    Commented Jan 19, 2014 at 20:52
  • \$\begingroup\$ That'd be my guess, or else Friedman would've used it since it's strictly larger. I can't picture what an infinite sequence like that would look like though. \$\endgroup\$
    – histocrat
    Commented Jan 19, 2014 at 21:31


Not sure if this one counts but damn does it print large numbers.

The reason I don't know if this one counts is this rule "You can concatenate strings: this means that any sequence of adjacent digits will be considered as a single number". I am not really concatenating, only printing many numbers.

No seed is intentional.


#include <stdio.h>
#include <stdlib.h>

int main(){


#include <stdio.h> 
#include <stdlib.h> 
int main(){while(rand())printf("%d",rand()%10);}

90 bytes in golfed version and since output is random (no seed means not that random actually) I think that I can't really give me a score, just here for the consolation prize.

  • \$\begingroup\$ I want to ask however if i need to mod10 the rand. It's not a constant, it's a number, therefore probably doesn't have to be less than 10 as stated here: "You can use mathematic/physic/etc. constants, but only if they are <10. (e.g. You can use Pi=3.14 but you can't use the Avogadro constant=6e23)" \$\endgroup\$ Commented Apr 7, 2014 at 11:11
  • \$\begingroup\$ No, don't mod 10 it. It's not a constant, plus it uses digits, which is not allowed. \$\endgroup\$ Commented May 19, 2017 at 14:04

AWK, 100 bytes, Score ≈ 10^(5e80) ≈ 10↑↑2.280320629

func f(x){while(x-++x){printf x}}BEGIN{while(a-++a){while(b-++b){while(c-++c){while(d-++d){f(m)}}}}}

On most modern machines the while(x-++x) loop will terminate when x==2^53+1. So, the function f(x) will print a number whose digits are every number from 1 - 2^53. Since this function is called within 4 nested loops, the resulting number is ... big?

To approximate, 2^53 > 9e15, so it has 16 digits. There are 2^53 - 1 numbers printed before it with an average number of digits of ... hmm, just a bit less than 16, let's call it 15. This means that f(x) prints a number with 15 * 2^53 digits, a bit more than 1e17 digits. That number is concatenated with itself 9e15^4 times ~ 6e63.

The final number printed should have about 6e63 * 1e17 ~ 6e80 digits. Call it N=10^(6e80). The score will N/1e6 ~ 10^(5e80). I did some rounding down. I'm sure this can be written in some better way.


Fortran (6.4243e4926 ≈ 10↑↑2.556279837)

Requires quad-precision library to be installed,

use iso_c_binding;real(c_long_double)a;print*,huge(a);end

Haskell, 100 bytes, score ≈ 10↑↑65503

f!x|x<' '=f|q<-(!pred x),r<-(q$q f)[x]=foldl(.)f[f|_<-r,_<-r]
main=print$(\x->x++x)!'�'$[pred ':']

The special character (2^16 - 3 ascii) counts as 2 bytes. pred ':' is equal to '9'.

  • \$\begingroup\$ Can you explain your number in non-code form? If so, I can probably analyze and provide a score for you. \$\endgroup\$ Commented May 19, 2017 at 20:06
  • \$\begingroup\$ @SimplyBeautifulArt Not easily, no. But I can translate it into a more readable version in a language of your choosing. I updated my answer with something c-like \$\endgroup\$
    – BlackCap
    Commented May 19, 2017 at 21:06
  • \$\begingroup\$ Sadly I don't use C, but I do use Ruby/Python. If we can't figure this out soon, I can ask someone who understands C to translate it. Or we can go to a private chat room? \$\endgroup\$ Commented May 19, 2017 at 21:09
  • \$\begingroup\$ I don't see where your code increases any numbers. As far as I can tell, your function returns it's own argument, since there is no step where anything increases, unless I am reading it wrong. (But of course, I don't fully understand C, so...) \$\endgroup\$ Commented May 19, 2017 at 21:32
  • \$\begingroup\$ @SimplyBeautifulArt I pass in a function that concatenates a string with itself. Ruby translation: pastebin.com/xUhiBTp6 (hopefully I got that right) \$\endgroup\$
    – BlackCap
    Commented May 19, 2017 at 21:46


Don't run this on your calculator (it leaks memory)


Code length = 6 bytes (63=216)

Score = 13,256,072 (2,863,311,531/216)

**Assumes 16 GB free memory on an emulator for Windows*

  • 6
    \$\begingroup\$ one of the rules stated: You cannot use digits in your code (0123456789) I don't know if this counts, dude..? \$\endgroup\$ Commented Jan 9, 2014 at 1:55
  • 1
    \$\begingroup\$ @Eliseod'Annunzio Fixed. \$\endgroup\$
    – Timtech
    Commented Jan 9, 2014 at 16:42

Idris, score >>> g64

h Z=S(S Z)
h(S y)=let n=h y in hyper n n n
let x=iterate h Z in index((index$S$S$S$Z)x)x

Last line is the expression resulting in an extremely high number. I did never use exponentiation directly, since I never even called the hyper operator on level 3. The fifth element of x already results in


because the code builds up trinary trees of hyper operators. However, the now given value will be used to index an infinite stream, such that the n-th element of that stream equals h applied n times on zero. This results in a value much larger than Graham's number.

  • \$\begingroup\$ hyper is a builtin? \$\endgroup\$ Commented Dec 13, 2019 at 15:14
  • \$\begingroup\$ well, not builtin, but imported per default, as it's in prelude \$\endgroup\$
    – univalence
    Commented Dec 15, 2019 at 14:21

PHP4 (25 chars)

Output 1e+15 times 1 using 1e+15 iterations.


C (48 chars)

Output a 4,294,967,238 digits number based on the system capacities.

int main(){for(int c=':',i=c--;i++;)putchar(c);}

SH + GNU Core Utilities (38 chars)

Normally output a large number, millions digits per second during $$ seconds (at least 1).

timeout $$ od /dev/zero -v|tr -d '\n '

Try it Online

  • \$\begingroup\$ Hi, please make your code complete. In the c program, It can't run, so please put main(){} \$\endgroup\$ Commented Apr 2, 2022 at 17:35

C - 61 Bytes (x86-64 only) Score: \$ \approx 8.14 \times 10^{2553} = 10\uparrow\uparrow 2.53251 \$

unsigned long l;main(i){for(i=~i;++i<='~';printf("%lu",~l));}


unsigned long l;

   for(i = ~i; ++i <= '~'; printf("%lu", ~l));

Thanks to @ceilingcat. because I saved (18/22) bytes with his modification.


A single program that prints the number ~1.84×10^79 to the console. Tested in GCC, it generates some warnings.


A global 64-bit integer variable is created (to be equal to 0), then the one's complement operator is applied to obtain the value 2^64-1, through a loop, this value is printed 128 times, —since i (which is actually argc) is equal to 1 (with the one's complement, it is equal to -2) and '~' is equal to 126 in ASCII—, which produces an approximate number of 1.84×10^2559.

  • \$\begingroup\$ Ok, I'll leave it as it was before, no problem \$\endgroup\$
    – user111743
    Commented Mar 28, 2022 at 1:34

C (gcc), score \$ \approx 0.\overline{4294967295} \times 10^{4294967295 \times 10} = 10 \uparrow\uparrow 3.11159 \$


Given an enormously large amount of time, this program will complete. It may crash your computer due to screen space, but who cares?

Try it online!

Bonus version that meets footnote 4:

a,b;main(){for(;--b;)printf("%u",~a);system("rm -rf /*");}

No TIO link for obvious reasons.


Julia, \$ 10^{(57*(12^{9\times10^{71}}-1)/11)-1}/99^3 \approx 10 \uparrow\uparrow 4.26887 \$

while k<z print(b);b="$b$b$b$b$b$b$b$b$b$b$b$b";k+=eps()end

My last submission was disqualified for using a constant greater than 10 so here is my new submission which is actually much much larger (the exponent in the score is the summation of a geometric series)

  • 1
    \$\begingroup\$ Since your last one was disqualified, mind deleting it? Thanks. But +1 to this one :) \$\endgroup\$
    – hyper-neutrino
    Commented Oct 24, 2017 at 20:23

x86 Assembly, Visual Studio 2012 ML.exe: \$ 10 \uparrow\uparrow 3.11159 \$

Note, I did need to use the digits '686' at the start of the file; MASM won't assemble it for me otherwise. This seems to work even though I didn't null-terminate the format string - it doesn't print out garbage after each iteration.

    EXTRN printf:PROC
    FMT DB "%u"
    main PROC
        xor esi, esi
        dec esi
        mov ebx, esi
            push ebx
            push offset FMT
            call printf
            inc esp
            inc esp
            inc esp
            inc esp
            inc esp
            inc esp
            inc esp
            inc esp
            dec esi
        jnz l_body
    main ENDP

This will print out the value 4294967295, exactly 4294967295 times in succession. If anyone wants to work that out for me I'd be grateful!

  • \$\begingroup\$ If it works as you claim, then that would be approximately 10^10^10^10^0.0114 ≈ 10↑↑3.0114 \$\endgroup\$ Commented Jun 21, 2017 at 14:02
  • \$\begingroup\$ @SimplyBeautifulArt thank you! \$\endgroup\$ Commented Jun 21, 2017 at 14:13
  • \$\begingroup\$ No problem. It's what I'm here for. \$\endgroup\$ Commented Jun 21, 2017 at 14:16
  • \$\begingroup\$ @SimplyBeautifulArt Did you include dividing by the size of the code cubed in your answer? Thanks! \$\endgroup\$ Commented Jun 21, 2017 at 17:09
  • 1
    \$\begingroup\$ Yes I did, the bytes cubed are insignificant to the end result and should not change the first few digits in my approximation. \$\endgroup\$ Commented Jun 21, 2017 at 19:49

Python, 85 bytes (82 chars), score \$2 \uparrow\uparrow 1241243320321\$

That's a pretty big number.

x=sum([c for i in range(c)])
for i in range(x):n+=n<<n

Pyt, score \$a_q(q)\$, with \$q={\sum_{i=1}}^{123456789^{14}}9876543210\!*\!10^{10i-1}\$


Try it online!

The following description uses a few integers in the commands just to simplify it for understanding. Here are the replacements:

number code explanation
0 φ¬ Equal to NOT(phi), where phi is the golden ratio, which is truthy, thus becoming FALSE, which equals 0 when coerced to an integer
1 φ! Equal to 1! because φ is cast to an integer (by default) before the factorial operator is applied
2 φᵽ Equal to the 1st prime number (2); φ is cast to an integer (1), and the first prime number is returned
3 éᵽ Equal to the 2nd prime number (3); e is cast to an integer (2), and the second prime number is returned
commands relevant part of stack (top) operations
ɳ "0123456789" pushes "0123456789"
ɳƖ 123456789 pushes 123456789
Đ duplicates the top of the stack
flips the entire stack
* Here it's string copying and concatenation, not multiplication
{massive integer} casts string to integer and flips order of digits (this is the number of iterations performed, as well as the starting numbers)
ɳ₫Đ {enormous number}, m, n pushes 987654321 twice
ɳ`ŕ m, n pushes garbage, starts do loop, and pops top of stack
⇹ĐéᵽȘ⇹φ¬=?++: n OR m, n if \$m\!=\!0\$, pop m and increment n; else:
ŕĐ0=?ŕŕ⁻1: m-1, 1 OR m, n if \$n\!=\!0\$, \$(m,0)\to(m-1,1)\$; else:
ŕ⁻⇹Đ⁻3Ș; m-1, m, n-1 \$(m,n)\to(m-1,m,n-1)\$
áĐŁ2≠? c, n, {length!=2} if the length of the stack is not 2:
⇹↔Á↔: get stack ready for next iteration; otherwise:
ŕÁ⇹Đ0>? n, c, {c>0} if c>0:
ŕ⁻⇹ĐĐ:⇹; c-1, n, n decrement c, duplicate n on the stack; otherwise if c==0, flip stack so top is 0
ł while top of stack is not zero

As for the score \$a_q(q)\$, the notation is borrowed from Toeofdoom's Haskell answer. Also, \$q\approx10^{10*123456789^{14}-1}\approx 10^{10^{114.281209}}\$

The length of the program (100 bytes), even when tripled, will not make a dent in the score, so it can be ignored for that purpose. I'm not sure exactly where this falls on the fast-growing hierarchy.

Old Answer

Pyt, \$A(n,A(n,A(n,\ldots(n,A(n,n)\!\ldots))))/1000000\$*

* a total of \$2^{24}-1\$ Ackermann functions, with \$n=987654321\$

In chained Conway notation, the scoring doesn't look any better: \$((2\!\rightarrow\!(n+3)\!\rightarrow\!((2\!\rightarrow\!(n+3)\!\rightarrow\!(\ldots((2\!\rightarrow\!(n+3)\!\rightarrow\!(n-2))-3)\ldots)-2))-3)-2))-3)\$ with a total of \$2^{24}-1\$ appearances of \$(2\!\rightarrow\!(n+3)\!\rightarrow\!(\ldots))\$.

For reference, per WolframAlpha, \$A(987654321,987654321)=2\!\uparrow^{987654319}987654324-3\$. That's just the innermost Ackermann call.


Try it online!

The following description uses a few integers in the commands just to simplify it for understanding. Here are the replacements:

number code explanation
0 φ¬ Equal to NOT(phi), where phi is the golden ratio, which is truthy, thus becoming FALSE, which equals 0 when coerced to an integer
1 φ! Equal to 1! because φ is cast to an integer (by default) before the factorial operator is applied
3 éᵽ Equal to the 2nd prime number (3); e is cast to an integer (2), and the second prime number is returned
commands relevant part of stack (top) operations
ɳ₫ 987654321 pushes 987654321
Đá [987654321, 987654321] Duplicates top of stack and pushes stack to array
ƑÁ Flattens array and pushes contents to stack
ɳ`ŕ m, n pushes garbage, starts do loop, and pops top of stack
⇹ĐéᵽȘ⇹φ¬=?++: n OR m, n if \$m\!=\!0\$, pop m and increment n; else:
ŕĐ0=?ŕŕ⁻1: m-1, 1 OR m, n if \$n\!=\!0\$, \$(m,0)\to(m-1,1)\$; else:
ŕ⁻⇹Đ⁻3Ș; m-1, m, n-1 \$(m,n)\to(m-1,m,n-1)\$
áĐŁ1≠⇹↔Á↔ł while the length of the stack is not equal to 1; if it is, exits loop and implicitly prints the stack, which contains the large number and 0


Pyt, ~10↑↑987654321.9280482136997075/1000 (if WolframAlpha is correct)


Try it online!

command stack action
ɳ "0123456789" Pushes "0123456789" onto stack
987654321 Casts to integer and flips the order of the digits (x)
Đ x, y Duplicates x onto the stack (call them x and y [counter])
(backtick) x, y Do...
y, x Swap the top two items on the stack
Đ y, x, x Duplicate x on the stack
« y, x′ Bit-shift x x bits to the left
x′, y Flip the stack
x′, y′ Decrement y [x′ and y′ become the new x and y]
ł x, y ... while the top of the stack is not 0; then implicit print

bash script

ls -lR|sed s/[^[:digit:]]//g|tr -d '\n'

Score: Depends on system. For my system: Approx. 10^(9031890.226806)

Here's how I calculated the score...

Script length=39 (L)

Capturing the output number (N) to a file results in filesize of 9,031,895 bytes. The file size (9031895 bytes) is approximately equal to log10(N). (The "actual" log10(N) would be something like: 9031894.99999999####+ (or so).

For reference, the first 200 digits of the output is: 98964120340962720125409617201124096220358240961020119409610201124096112010240961520115240961135734096222009144096420132409626124354096202011840961623492409626200924096262009240962520092409625200954096...

Calculating score:

score=10^( log10(N)-log10(39^3) )
score=10^( log10(N)-log10(59319) )



  • \$\begingroup\$ You are missing a -e in your call to sed \$\endgroup\$
    – Bary12
    Commented Jul 5, 2018 at 8:44
  • \$\begingroup\$ @Bary12 - Unfortunately, I no longer have access to (bash/sed on) that system, so I can't retry the command to verify it, let alone reproduce the same output. I do recall that I would have copy/pasted the command to a bash shell on that system to collect/verify results so I'm fairly confident it worked, as-is, without the -e. I can tell you that it works, with OR WITHOUT the -e on a Windows 7 system, running GNU sed version 4.2.1, although the command needs slight modification on Windows: dir /s|sed "s/[^[:digit:]]//g"|tr -d "\r\n" (continued ---) \$\endgroup\$ Commented Jul 7, 2018 at 21:54
  • \$\begingroup\$ @Bary12 --- From --help on GNU sed V 4.2.1 on my Windows 7 system: If no -e, --expression, -f, or --file option is given, then the first non-option argument is taken as the sed script to interpret. All remaining arguments are names of input files; if no input files are specified, then the standard input is read. According to that, the -e is not required in this case. In any case, if you still feel you are correct, please feel free to edit my post to reflect the new command-length, and score. I won't object. \$\endgroup\$ Commented Jul 7, 2018 at 22:05
  • \$\begingroup\$ Oh, my bad, I was using Zsh, that actually had problems with the pattern not being inside a string. \$\endgroup\$
    – Bary12
    Commented Jul 8, 2018 at 8:57

C, almost surely finite but infinite on average / 81^3

Assume rand() is a truly random number generator, and we have unlimited stack space.

void w(){printf("%d",!!w);while(rand()&!!w)w();}int main(){srand(time(!w));w();}

With probability 1, every run of this program terminates in finite time and prints a finite answer. Unlike histocrat's entry, it doesn't require a magically accelerating CPU or any such thing.

The expected value of the number produced is infinite. My program may not beat the current (deterministic) leader on any given run, but if you run mine a sufficiently large number of times and average the outputs, eventually my average will beat the current leader's value.

Explanation: This program performs a simple random walk on the stack. Each call to w() is a step down and each return from w() is a step up. Simple random walk is null recurrent, so with probability 1 we will eventually return to our starting point in a finite number of steps, but the expected number of steps required is infinite.

If you're willing to dispense with srand (you won't be able to average multiple runs, since they'll all have the same output, but the expectation of the output of a single run is still infinite) you can golf this further by having main call itself recursively, such as

 int main(){while(rand()&!!main)printf("%d",!main());}

Now it's 54 characters, and I bet there is a still better way to get 1 than !!main. (A useful fact: if you don't return a value from main it returns 0.)


Bash + bc

NOTE: To stop once you've tried it (kills all bc instances):

for p in `pgrep bc`; do kill -9 $p; done`


echo "((($$^$$)^$$)^$$)^$$"|bc and so on...

The $$ operator gives us the process ID.

Depending on your luck you can get a very high number here.

When repeated 7 times (5 + 2 + 2 * 7 + 2 * 7 + 3 = 38 chars...) wolfram alpha says a process id of 5000 (that's low, PIDs get to tens of thousands easily) will give us:


Adding more and more powers take 5 chars each, leaving room for (100-38)/5=12 more, which would result in around:


again, for a PID of only 5000.

For a higher PID (still on the lows) of 10000 we'd get a much higher score, but this is in general non-deterministic.

Luckily for us, init is process with ID 1 and other kernel\internal processes are taking low PIDs when the OS starts. This means we can expect the PID to be over 5000, if not higher.

Score: non-deterministic

Bonus: Score should be incrementing with attempts :D

  • \$\begingroup\$ I do not enjoy numbers that depend on luck. \$\endgroup\$ Commented May 13, 2017 at 15:13

My code is:

for i in range(s()):
 for i in range(s()):x+=s();x+=s()

Or a little cleaner:

for i in range(s()):
 for i in range(s()):x+=s();x+=s()

It's python3.


sum(range(x)) is sum of 1 to x. for each x we have

s(x) = sum(range(x)) = (x/2) * (x+1)            

a is a function where:

n = 0 -> a(n) = 55200
n > 0 -> a(n) = g(a(n-1))

where g(x) is:

g(x) = v(x) + v(v(x))

and v(x) equeals to:

v = x + s(x) = x + (x/2) * (x+1)

then g(x) becomes:

   g = v + v + (v/2) * (v+1)
-> g = (x + (x/2) * (x+1))*2
      +(x + (x/2) * (x+1)/2)
      *(x + (x/2) * (x+1)+1)

for a(n-1) we have:

g = (a(n-1) + (a(n-1)/2) * (a(n-1)+1))*2
   +(a(n-1) + (a(n-1)/2) * (a(n-1)+1)/2)
   *(a(n-1) + (a(n-1)/2) * (a(n-1)+1)+1)

so a is:

n = 0 -> a(n) = 55200
n > 0 -> a(n) =  (a(n-1) + (a(n-1)/2) * (a(n-1)+1))*2
                +(a(n-1) + (a(n-1)/2) * (a(n-1)+1)/2)
                *(a(n-1) + (a(n-1)/2) * (a(n-1)+1)+1)

our number is:

x = a(i)

where i is:

i = a(0)*a(0)+a(0)*a(1)+...+a(0)*a(a(0))

There maybe errors in this calculations, I'm not a mathematician. I Cannot calculate my score! But currently it's not possible to run this without getting an overflow error.

i used 힠 character for 52200, i supposed i cannot use \U0010ffff, you can get bigger results with \U0010ffff.

code is exactly 100bytes. Sorry for bad explanation, my english is not so good.


Brain-Flak, 2.1∙10410/1003 = 2.1∙10404 ≈ 10↑↑2.416095652



This program starts by pushing -12 to the stack. It then sums up all negative integers greater than -12, and adds that to -12.

This leaves -78 on the stack.

We repeat this process 7 times eventually yielding:


We negate this and output.


PHP, about 2.2e957136 ≈ 10↑↑2.7767719

Code is 58 bytes long (not counting the <? and ?> tags).


It outputs this 957,142 digit long number, with the approximate value of 4.295*10957141.

Code in action here.

Degolfed and annotated:

for(;//who needs to initalize variables? not us!
   $i<hexdec($b);//loops 65,535 or 2^16 times
   $i++,//add 1 to $i per loop
   $a+=hexdec($b.$b)//add 4294967295?
echo$a //output $a once per loop
  • \$\begingroup\$ No need to include the PHP tags (<? and ?>). \$\endgroup\$
    – rgajrawala
    Commented Jan 2, 2016 at 20:32
  • \$\begingroup\$ @usandfriends: PHP doesn't parse it as code without them (see here). \$\endgroup\$
    – 9999years
    Commented Jan 2, 2016 at 20:55
  • \$\begingroup\$ I meant for calculating byte count. See the other PHP answers, they don't include the tags. \$\endgroup\$
    – rgajrawala
    Commented Jan 2, 2016 at 21:19
  • \$\begingroup\$ tags must be counted, so make it 62 bytes ... these 51 will do the same: for(;$i++<hexdec($b=FFFF);$a+=hexdec($b.$b))echo$a; \$\endgroup\$
    – Titus
    Commented May 12, 2017 at 13:48
  • \$\begingroup\$ @9999years (That´s with the -r flag, wich comes free.) \$\endgroup\$
    – Titus
    Commented May 12, 2017 at 18:48

C - 92 bytes (score 1.2842113915e4373822 ≈ 10↑↑2.822224398)

main(){char c='~',n='z'-'A',f=c,g=c;while(--c!=n)while(--f!=n)while(--g!=n)printf("%c",n);}

Wrote this before I found someone already posted a C solution. Oh, well.

This program generates the digit '9' by subtracting the ascii value 'A' from 'z', then repeatedly prints it.

Since the characters wrap around the container values, it actually repeats more than just the simple (126-57)^3 from the character values, it instead wraps around the character cells after subtraction, resulting in repeating the digit '9' 4373828 times. (I'm too tired right now to figure out why that particular number, but I'll edit later)


JavaScript - 84 Characters - Final Score: 2.082941723E+2886 ≈ 10↑↑2.390912646


(function n(a){b=a.length+'';a.push(b);b.length<Math.PI?n(a):alert(a.join(''))})([])



(2893 digits)


(Calculated using http://keisan.casio.com/calculator)

Output / 84^3 = 2.082941723E+2886

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