Hyperoperations

Hyperoperations are the next step after exponentiation in terms of recursive math. For example, 2 times 3 equals 2 + 2 + 2. The operation after exponentiation, called tetration applies exponentiation repeatedly: 2[tetration]3= 2^2^2

Implementation in Visual Basic:

Function Math(ByVal X, Y, Z) As ULong Dim R As ULong R = X

If Z = 1 Then

R = X + 1 Return R       ElseIf Z = 2 Then For index = 1 To (Y) R = Math(R, X, Z - 1) Next Else For index = 1 To (Y - 1) R = Math(R, X, Z - 1) Next

End If

Return R   End Function

The implementation above does 2[tetration]4(Math(2,4,5)) as (((2^2)^2)^2), working from bottom up. Normally tetration would go the other way, so 2[tetration]4 would give 65536(instead of 256). However if 1 is the increment operation(x[1]y=x+1 for all y) then addition, multiplication and exponentiation hold the following property: (2[n]3) [-(n-1)] 2 = 4 (-z in x[-z]y stands for the opposite operation of z(ie: the opposite of addition is subtraction)) Examples: That property is lost if we choose to evaluate hyperoperations above exponetiation as (x^(y^y)) instead of ((x^y)^y)
 * (2[2]3) [-(2-1)] 2 = (2+3) [-1] 2 = 5[-1]2=4 (-1= decrement)
 * (2[3]3) [-(3-1)] 2= (2*3) [-2] 2 = 6 [-2] 2=4 (-2= subtraction)
 * (2[4]3) [-(4-1)] 2= (2^3) [-3] 2 = 8 [-3] 2=4 (-3= divison)
 * (2[5]3) [-(5-1)] 2= ((2^2)^2) [-4] 2 = 16 [-4] 2=4 (-4= root)
 * (2[6]3) [-(6-1)] 2= (((2^2)^2)^2) [-5] 2 = 256 [-5] 2=4 (-5= root of root)