That's mathematics by Tom Lehrer
Unary
In base
Number names in
Power with base
Factorial
Knuth's up-arrows with base
Ackermann function
Ordinal hierarchy:
This is a basic explanation of the game concepts. It will be extended over the course of the game with further tabs about the underlying math.
- Game concepts
- Ordinals
- Naming
- Power tower
- Up-arrows
- Ackermann
- Hierarchies
Upgrades
You can get more & better cookie-making buttons using upgrades, which are obtained by clicking on the upgrade once enough challenges are satisfied. Note that challenges don't need to be satisfied in order, but upgrades must be taken in order, so the challenges can get rearranged. There are two types of challenges
- Exact challenges: They are highlighted in orange, and they are satisfied when the cookie display shows exactly what is shown on the challenge. Note that on one hand, you might need to set the display options to satisfy the challenge, on the other hand, the number itself sometimes does not need to match exactly (if it is large). Only the approximation shown by the display matters.
- Size challenge: They are satisfied once you have at least as many cookies as the challenge shows. On the rare occasion of the display showing the same number of cookies, it might be below or above, since the display shows numbers with lower precision than they are internally stored.
Display Settings
On the right of the table of upgrades, you can select the preferred number display. A magnet shows the preferred display, and it can be unselected again. The preferred display is applied to the main cookie display as well as to all the levels in Bakery. The orange background shows the display setting currently used by the main cookie display (prefered display can be ignored if the number is too much out of range).
Bakery
You can make cookies using buttons. There are three types of buttons, each of which starts with level one, but can be upgraded during the game.
- Make a cookie: adds as many cookies as is its level.
- Level up: Adds its level to the button above. If click propagation is enabled, it also clicks on that.
- Add a button: Adds as many buttons above as is its level. If click propagation is enabled, it also clicks on the newly added buttons.
Once you get the Click propagation upgrade, you can enable it at the top of the button column.
Once button packing is enabled, you can pack a list of buttons by clicking on an arrow at its bottom left. The button lists also pack automatically if the number of buttons gets big. For a pack of buttons, the "level" column shows the number of top-level buttons inside. It is basically how many times the "Add Button" below was clicked.
Eat all & saving progress
The "Eat all" button (if available):
- eats all the cookies,
- eats (almost) all the buttons but is guaranteed to keep the last button and its level,
- keeps all the obtained upgrades.
Once "Eat all" is obtained, it is equivalent to reloading the page. In general, the page remembers (in website cookies) the obtained upgrades, so it is mostly safe to close / reopen the game.
In fact, the "Ord." in the button table could stand either for "order" or "ordinal". Ordinals form a continuation of natural numbers. The first infinite ordinal is $\omega$; however, we should underscore that in this cookie clicker, there is never anything truly infinite. You should only think of infinity as potential infinity: the $\omega$-th button always only has finitely many buttons above, but there is no fixed limit of how many buttons could be there.
There are three types of countable ordinals corresponding to the three buttons
- Zero: there is just a single zero at the beginning
- Successor ordinal: if it has an immediate predecessor
- Limit ordinal: if there is an increasing sequence converging to that ordinal.
For example:
- the sequence converging to $\omega$ is $0$, $1$, $2$, $3$, ...
- the sequence converging to $\omega\cdot2$ is $\omega$, $\omega+1$, $\omega+2$, $\omega+3$, ...
- the sequence converging to $\omega^2$ is $0$, $\omega$, $\omega\cdot2$, $\omega\cdot3$, ...
In general, there can be multiple sequences converging to the same ordinal, for example also $0$, $\omega$, $\omega$, $\omega+2$, $\omega+4$, ... converges to $\omega\cdot2$ but for small enough ordinals, people have fixed their canonical sequences. For an ordinal $\alpha$, by $\alpha[i]$ we denote the $i$-th element of the canonical sequence converging to $\alpha$ indexed from zero. So for example $\omega[i] = i$, $(\omega\cdot2)[i] = \omega+i$, and $\omega^2[i] = \omega\cdot i$.
In the game, the canonical sequences define which buttons exactly are being added each time a button at a limit ordinal is clicked. When clicked on $\alpha$ (assume for simplicity that we click once, and the level is one), the new button is at $\alpha[i]$ where $i > 0$ is the smallest possible index such that $\alpha[i]$ has not yet been added. Note that even with click propagation, this will never cause an infinite chain reaction; it is a fundamental property of ordinals that there is never an infinite decreasing sequence of them. So all the clicks eventually propagate to zero in finite time.
For ordinals $\alpha, \beta$ up to $\varepsilon_0$, the canonical sequences are defined by:
- $(\alpha + \beta)[i] = \alpha + (\beta[i])$, if $\alpha \ge \beta$,
- $\omega^{\alpha+1}[i] = \omega^\alpha\cdot i$,
- $\omega^\alpha[i] = \omega^{\alpha[i]}$, if $\alpha < \varepsilon_0$ is a limit ordinal.
- $\varepsilon_0[0] = 1$
- $\varepsilon_0[i+1] = \omega^{\varepsilon_0[i]}$
So for example \[ \varepsilon_0[3] = \omega^{\omega^\omega}, \quad\text{and}\quad \omega^{\omega^\omega\cdot2}[3] = \omega^{\omega^\omega + \omega^\omega}[3] = \omega^{\omega^\omega + \omega^\omega[3]} = \omega^{\omega^\omega + \omega^3} \]
Although everyone agrees that 1 000 is a thousand, and 1 000 000 is a million, the names beyond experience two confusingly different numbering systems: the short and long scale. In the short scale (used in English-speaking countries), the "ion" sequence grows by gradual multiplication by thousand: million, billion, trillion, ... On the other hand, in the long scale (used for example in continental Europe), the same sequence grows by multiples of 1 000 000, and inserts the "iard" number name after each "ion". See the following table for comparison.
| 1 000 | thousand | thousand |
| 1 000 000 | million | million |
| 1 000 000 000 | billion | milliard |
| 1 000 000 000 000 | trillion | billion |
| 1 000 000 000 000 000 | quadrillion | billiard |
| 1 000 000 000 000 000 000 | quintillion | trillion |
In the game, you can choose the scale used for displaying the number of cookies and button levels. By default, we are using the short scale, but if the system uses a long scale, it shows it by appending "(long)".
The system was not originally intended to name arbitrarily large numbers, but was later extended to do so by Jacques Peletier du Mans in medieval France. To name an $n$-th "ion" number where $n \geq 1000$, we split $n$ into tripples, write a Latin-like word for each tripple (as a 3-digit number), and join them with "illi". For example, the number with $3 \cdot 12\ 345 + 3$ zeros (in the short scale), is called duodecilliquinquadragintatrecentillion because "duodeci" encodes 12, and "quinquadragintatrecenti" encodes 345.
More on Wikipedia: Long & Short scales, Names of large numbers
Powers and factorials have comparably similar size (from the large number perspective). Their definitions are well-known. \[ a^b = \underbrace{a \cdot a \cdots a}_{b \times}, \quad\text{and}\quad n! = \underbrace{1 \cdot 2 \cdots n}_{n}. \] Note that when building a power tower, we always evaluate the top first, which helps to reach big numbers. For example $10^{10^{10}} = 10^{\left(10^{10}\right)}$ is a number with $10^{10} =$ ten billion zeros. On the contrary, if we evaluated this power tower form the bottom, we get $\left(10^{10}\right)^{10} = 10^{10^2}$ which is a number with "only" one hundred zeros.
Knuth's up-arrow notation, such as $10 \uparrow\uparrow 30$, is a natural generalization of exponentiation. A single arrow is just a standard power; the double arrow is a power tower, etc. \[ a \uparrow b = a^b = \underbrace{a \cdot a \cdots a}_{b \times}, \quad a \uparrow\uparrow b = \underbrace{a \uparrow a \uparrow\cdot \uparrow a}_{b \times}, \quad a \uparrow^{n+1} b = \underbrace{a \uparrow^n a \uparrow^n\cdot \uparrow^n a}_{b \times}. \] It is just a matter of notation whether we write the arrows explicitly or with a superscript. For example $a \uparrow^4 b = a \uparrow\uparrow\uparrow\uparrow b$.
Similar to evaluating power towers, we always evaluate Knuth's up-arrows from right to left, so $a \uparrow b \uparrow c \uparrow d = a \uparrow (b \uparrow (c \uparrow d))$. You can test setting different bases (the number on the left), but you will notice that it doesn't make much difference.
Although the original Ackermann's function was slightly different, today the Ackermann function refers to the following definition. We start by defining a two-argument function $A_m(n)$ where $m$, $n$ are non-negative integers by the following recurrence formula: \[ A_0(n) = n+1, \quad A_{m+1}(n) = \underbrace{A_m(A_m(A_m(\cdots A_m(}_{(m+1) \times}1)\cdots))). \] The single-argument Ackermann function is just a simplification $A(n) = A_n(n)$. The two-argument Ackermann function can be evaluated using up-arrow notation.
| $0$ | $n+1$ |
| $1$ | $n+2$ |
| $2$ | $2n+3$ |
| $3$ | $2^{n+3} - 3$ |
| $4$ | $(2 \uparrow\uparrow (n+3)) - 3$ |
| $m \ge 3$ | $(2 \uparrow^{m-2}(n+3)) - 3$ |
Fast-growing Hierarchy
The fast growing hierarchy $f_\alpha(n)$ is defined for any integer $n\ge 0$, and a countable ordinal number $\alpha$ by
- $f_0(n) = n+1$,
- $f_{\alpha+1}(n) = f_\alpha^n(n) = \underbrace{f_\alpha(f_\alpha(f_\alpha(\cdots f_\alpha(}_{n \times}n)\cdots)))$,
- $f_\alpha(n) = f_{\alpha[n]}(n)$ if $a$ is a limit ordinal.
So for example $f_1(n) = 2n$, $f_2(n) = n \cdot 2^n$, ... Notice that the only difference in the definitions of $A_\alpha$ and $f_\alpha$ for a natural number $\alpha$ is that $A_\alpha$ starts with $A_m(1)$, whereas $f_\alpha$ starts with $n$. As a consequence, $A(n)$ and $f_\omega(n)$ have a similar growth rate in the sense that $A(n) < f_\omega(n+1),$ and $f_\omega(n) < A(n+1)$.
Hardy Hierarchy
Another ordinal-based hierarchy is the Hardy hierarchy, defined by:
- $H_0(n) = n$,
- $H_{\alpha+1}(n) = H_\alpha(n+1)$,
- $H_\alpha(n) = H_{\alpha[n]}(n)$ if $a$ is a limit ordinal.
This obviously grows much slower than the fast-growing hierarchy, for example $H_\omega(n) = 2n$ compared to $f_1(n) = 2n$. On the other hand, there is a close correspondence between Hardy and fast-growing hierarchies. You can figure out by playing with them 😉.
More on Wikipedia: Fast-growing hierarchy, Hardy hierarchy
You reached the limit of what this game is capable of. Well done!
What about your initial guess? Did you reach it? Or was our cookie clicker disappointing to have too small numbers in it? There indeed exist much bigger numbers, basically in two categories:
- Direct constructions, these usually construct much larger (countable) ordinal numbers than $\varepsilon_0$. The famous number TREE(3) is somewhere among such numbers. There is a debate of how large TREE(3) exactly is, but there seems to be a consensus that it is much larger than $f_{\varepsilon_0}(n)$ for any reasonable $n$, but also smaller than some of the $f_\alpha(3)$, for certain known explicit countable ordinals $\alpha$.
- Tricks with logic. The most famous one is Busy Beaver: take the smallest number that cannot be calculated with a theoretical program of size less than 10100. There are also weaker and stronger variants of this number. For a weaker variant, we can only accept such programs that some strong mathematical theory (say ZFC) can prove that they terminate with a proof smaller than 10100. This makes the number theoretically computable. On the other hand, if we ask for the smallest number not expressible in the language of set theory itself, we get to Rayo's number, which is among the biggest ever defined. This number is a little questionable because it is not definable in the language of first order set theory, and if you continued further, you could end up with the paradox of "Smallest number that cannot be expressed with 1000 English words or fewer", which we should agree is self-contradictory, and hence not a valid definition.
Anyway, I hope that you enjoyed the game and learned something.
External Links
- Googology Wiki is a Wiki dedicated to large numbers.
- Further idle games I know
- The original Cookie Clicker that started this genre. On the other hand, the numbers you can get there are relatively low.
- Universal paperclips about an A.I. that got a task of making as many paperclips as possible. Unfortunatelly, even an A.I. is limited by the laws of physics.
- Ordinal markup is a game that reaches even bigger numbers than Cookie Clicker Ultra. On the other hand, it provides less insight what the numbers it is producing actually mean.
- Ordinaly World is my game about exploring recursive countable ordinals. It is not fully finished but playable.
Cookie Clicker Ultra is an edutainment game made by Mirek Olšák for SoME 2025.
The goal of the game is to get as many cookies as possible.
While it doesn't hide its inspiration by standard idle games, its main purpose is to allow the player to "touch the large numbers".
Source code is published on our Forgejo instance.
Debug tools
Debug tools help to get through the game faster or explore the underlying mechanisms.
Speeding up game
- When Debug tools are enabled (since now always, until you delete progress), you can press the key 'c', which is equivalent to clicking the last button 100 times.
-
Show all documentation & setting options
This doesn't influence the game but unlocks all the hidden HTML parts. -
Allow upgrade cheating
With upgrade cheating enabled, you can click on an arbitrary upgrade row and make the condition satisfied. - Upgrade cheating above doesn't help if there are no more upgrades available. These upgrades usually appear when a certain cookie threshold is reached. However, you can also get them by clicking the button "Show next upgrade".
Other tools
-
Pause propagation animation
When propagation is paused and enabled, you need to make every propagation step by pressing 's'. -
If you click on "delete progress", you will erase all the game progress after reloading the page. Before reloading, you can also revert the action by clicking "Keep progress"
.png)


