3 *WARNING: brain exploding article*
7 { This article contains unoriginal research with errors and TODOs, read at own risk. Some really interesting and more in-dept information can be found at this nice site: http://mrob.com/pub/math/largenum.html. Also the rabbithole of big numbers and googology is so deep I can't even see the end of it. ~drummyfish }
9 Hyperoperations are [mathematical](math.md) operations that are generalizations/continuations of the basic arithmetic operations of addition, multiplication, exponentiation etc. Basically they're like the basic operations like plus but on steroids. When we realize that multiplication is just repeated addition and exponentiation is just repeated multiplication, it is possible to continue in the same spirit and keep inventing new operations by simply saying that a new operation means repeating the previously defined operation, so we define repeated exponentiation, which we call tetration, then we define repeated tetration, which we call pentation, etc.
11 There are infinitely many hyperoperations as we can go on and on in defining new operations, however we start with what seems to be the simplest operation we can think of: the successor operation (we may call it *succ*, *+1*, *++*, *next*, *increment*, *zeration* or similarly). In the context of hyperoperations we call this operation *hyper0*. Successor is a [unary](unary.md) operator, i.e. it takes just one number and returns the number immediately after it (suppose we're working with [natural numbers](natural_number.md)). In this successor is a bit special because all the higher operations we are going to define will be binary (taking two numbers). After successor we define the next operation, addition (*hyper1*), or *a + b*, as repeatedly applying the successor operation *b* times on number *a*. After this we define multiplication (*hyper2*), or *a * b*, as a chain of *b* numbers *a*s which we add together. Similarly we then define exponentiation (*hyper3*, or raising *a* to the power of *b*). Next we define tetration (*hyper4*, building so called [power towers](power_tower.md)), pentation (*hyper5*), hexation (*hyper6*) and so on (heptation, octation, ...).
13 Indeed the numbers obtained by high order hyperoperations grow quickly as [fuck](fuck.md).
15 An important note is this: there are multiple ways to define the hyperoperations, the most common one seems to be by supposing the **right associative** evaluation, which is what we're going to implicitly consider from now on. This means that once associativity starts to matter, we will be evaluating the expression chains FROM RIGHT, which may give different results than evaluating them from left (consider e.g. `2^(2^3) != (2^2)^3`). The names tetration, pentation etc. are reserved for right associativity operations.
17 The following is a sum-up of the basic hyperoperations as they are commonly defined (note that many different symbols are used for these operations throughout literature, often e.g. up arrows are used to denote them):
19 | operation |symbol | meaning |commutative|associative|
20 |------------------------|----------|-------------------------------------------------|-----------|-----------|
21 |successor (hyper0) |`succ(a)` |next after *a* | | |
22 |addition (hyper1) |`a + b` |`succ(succ(succ(...a...)))`, *b* succs | yes | yes |
23 |multiplication (hyper2) |`a * b` |`0 + (a + a + a + ...)`, *b* *a*s in brackets | yes | yes |
24 |exponentiation (hyper3) |`a ^ b` |`1 * (a * a * a * ...)`, *b* *a*s in brackets | no | no |
25 |tetration (hyper4) |`a ^^ b` |`1 * (a ^ (a ^ (a ^ (...)`, *b* *a*s in brackets | no | no |
26 |pentation (hyper5) |`a ^^^ b` |`1 * (a^^ (a^^ (a^^ (...)`, *b* *a*s in brackets | no | no |
27 |hexation (hyper6) |`a ^^^^ b`|`1 * (a^^^(a^^^(a^^^(...)`, *b* *a*s in brackets | no | no |
28 |... | | | no more | no more |
30 The following ASCII masterpiece shows the number [2](two.md) in the territory of these hyperoperations:
32 { When performing these calculations, use some special calculator that allows extremely high numbers such as HyperCalc (http://mrob.com/pub/comp/hypercalc/hypercalc-javascript.html) or Wolfram Alpha. ~drummyfish }
35 2 +1 +1 +1 +1 +1 +1 +1 ... successor
39 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 ... addition
41 | | / ____________________/
43 2 * 2 * 2 * 2 * 2 * 2 * 2 * 2 ... multiplication
44 | |4 8 __/ 16 32 64 128 256
46 | | / ~10^(6 * 10^19728)
47 2 ^ (2 ^ (2 ^ (2 ^ (2 ^ (2 ^ (2 ^ (2 ... exponentiation
48 | |4 16__/ 65536 ~10^19728 ~10^(10^(10^19728))
49 | | / not sure about arrows here, numbers get too big, TODO
51 2 ^^(2 ^^(2 ^^(2 ^^(2 ^^(2 ^^(2 ^^(2 ... tetration
53 | | | not sure about arrows here either
55 2 ^^^(2 ^^^(2 ^^^(2 ^^^(2 ^^^(2 ^^^(2 ^^^(2 ... pentation
59 Some things generally hold about hyperoperations, for example for any operation *f = hyperN* where *N >= 3* and any number *x* it is true that *f(1,x) = 1* (just as raising 1 to anything gives 1).
61 [Hyperroot](hyperroot.md) is the generalization of [square root](sqrt.md), i.e. for example for tetration the *n*th hyperroot of number *a* is such number *x* that *tetration(x,n) = a*.
63 **Left associativity hyperoperations**: Alternatively left association can be considered for defining hyperoperations which gives different operations. However this is usually not considered because, as mentioned in the webpage above, e.g. left association tetration *a ^^ b* can be simplified to *a ^ (a ^ (b - 1))* and so it isn't really a new operation. Anyway, here is the same picture as above, but for left associativity -- we see the numbers don't grow THAT quickly (but still pretty quickly).
66 2 +1 +1 +1 +1 +1 +1 +1 ... successor
70 2 + 2 + 2 + 2 + 2 + 2 + 2 + 2 ... addition
72 | | / ____________________/
74 2 * 2 * 2 * 2 * 2 * 2 * 2 * 2 ... multiplication
75 | |4 __/ 16 32 64 128 / 256
76 | | / ____________________/
78 (2 ^ 2) ^ 2) ^ 2) ^ 2) ^ 2) ^ 2) ^ 2 ... left exponentiation
79 | |4 16__/ 256 65536 ~3*10^38
80 | | / ____________________________
82 (2 ^^ 2) ^^ 2) ^^ 2) ^^ 2) ^^ 2) ^^ 2) ^^ 2 ... left tetration
86 (2 ^^^ 2)^^^ 2)^^^ 2)^^^ 2)^^^ 2)^^^ 2)^^^ 2 ... left pentation
90 In fact we may choose to randomly combine left and right associativity to get all kinds of weird hyperoperations. For example we may define tetration with right associativity but then use left associativity for the next operation above it (we could call it e.g. "right-left pentation"), so in fact we get a binary [tree](tree.md) of hyperoperations here (as shown by M. Muller in his paper on this topic).
92 Of course, we can now go further and start inventing things such as hyperlogarithms, hyperfactorials etc.
96 Here's a [C](c.md) implementation of some hyperoperations including a general hyperN operation and an option to set left or right associativity (however note that even with 64 bit ints numbers overflow very quickly here):
100 #include <inttypes.h>
103 #define ASSOC_R 1 // right associativity?
106 uint64_t succ(uint64_t a)
112 uint64_t add(uint64_t a, uint64_t b)
114 for (uint64_t i = 0; i < b; ++i)
122 uint64_t multiply(uint64_t a, uint64_t b)
126 for (uint64_t i = 0; i < b; ++i)
133 // hyper(n + 1) for n > 2
134 uint64_t nextOperation(uint64_t a, uint64_t b, uint64_t (*operation)(uint64_t,uint64_t))
141 for (uint64_t i = 0; i < b - 1; ++i)
153 uint64_t exponentiate(uint64_t a, uint64_t b)
155 return nextOperation(a,b,multiply);
159 uint64_t tetrate(uint64_t a, uint64_t b)
161 return nextOperation(a,b,exponentiate);
165 uint64_t pentate(uint64_t a, uint64_t b)
167 return nextOperation(a,b,tetrate);
171 uint64_t hexate(uint64_t a, uint64_t b)
173 return nextOperation(a,b,pentate);
177 uint64_t hyperN(uint64_t a, uint64_t b, uint8_t n)
181 case 0: return succ(a); break;
182 case 1: return add(a,b); break;
183 case 2: return multiply(a,b); break;
184 case 3: return exponentiate(a,b); break;
193 for (uint64_t i = 0; i < b - 1; ++i)
207 printf("\t0\t1\t2\t3\n");
209 for (uint64_t b = 0; b < 4; ++b)
211 printf("%" PRIu64 "\t",b);
213 for (uint64_t a = 0; a < 4; ++a)
214 printf("%" PRIu64 "\t",tetrate(a,b));
223 In this form the code prints a table for right associativity tetration:
230 3 0 1 16 7625597484987
235 - [googology](googology.md)
236 - [p-adic numbers](p_adic.md)