Hyper-E notation

Hyper-E Notation (E# for short) is a notation for large numbers devised by Sbiis Saibian. It was first introduced on his Web book "One to Infinity: A Finite Journey" in November 2011, and was generalized to Extended Hyper-E Notation (xE# for short). Hyper-E Notation is a refined version of a notation Sbiis Saibian devised as a child.

Original definition
The original Hyper-E Notation consists of a sequence of one or more positive integer arguments separated by hyperions #. We notate this as E(b)##...#. b is called the base &mdash; if it is omitted, as it often is, it defaults to 10.

The three rules are as follows:


 * Rule 1. If there are no hyperions:
 * \(E(b)x = b^x\).
 * Rule 2. If the last entry is 1:
 * \(E(b){a_1}\#{a_2}\#{a_3}\cdots\#{a_n}\#1 = E(b){a_1}\#{a_2}\#{a_3}\cdots\#{a_n}\).
 * Rule 3. Otherwise:
 * \(E(b){a_1}\#{a_2}\#{a_3}\cdots\#{a_{n-2}}\#{a_{n-1}}\#{a_n} =\)
 * \(= E(b){a_1}\#{a_2}\#{a_3}\cdots\#{a_{n-2}}\#(E(b){a_1}\#{a_2}\#{a_3}\cdots\#{a_{n-2}}\#{a_{n-1}}\#{a_n-1})\)

In plain English:


 * 1) If there is only one argument x, the value of the expression is.
 * 2) If the last entry is 1, it may be removed.
 * 3) Otherwise...
 * 4) Evaluate the original expression, but with the last entry decreased by 1. Call this value z.
 * 5) Remove the last two entries of the expression.
 * 6) Add z as an entry to the end of the expression.

Extended definition
Extended Hyper-E Notation allows multiple hyperions to appear between each entry. The number of hyperions following entry is represented by h(n). For the sake of this definition,  is a shorthand for n successive hyperion marks. For example, a full expression would be written E(b).... Saibian uses @ to indicate rest of expression such as Bowers uses # to indicate rest of array.

Rule 1. Condition: no hyperions:


 * \(E(b)x = b^x\).

Rule 2. Condition: last entry is 1:


 * \(E(b) @ \#^{h(n-1)}{a_n}\#^{h(n)}1 = E(b) @ \#^{h(n-1)}{a_n}\).

Rule 3. Condition: \(h(n-1)>1\):


 * \(E(b) @ \#^{h(n-2)}{a_{n-1}}\#^{h(n-1)}{a_n} = E(b) @ \#^{h(n-2)}{a_{n-1}}\#^{h(n-1)-1}{a_{n-1}}\#^{h(n-1)}{a_n-1}\)

Rule 4. Condition: Rules 1-3 doesn't apply:


 * \(E(b) @ \#^{h(n-2)}{a_{n-1}}\#{a_n} = E(b) @ \#^{h(n-2)}(E(b) @ \#^{h(n-2)}{a_{n-1}}\#{a_n-1})\)

It seems similar to linear array notation rules. We can also rewrite it in plain English:


 * 1) If there is only one argument x, the value of the expression is.
 * 2) If the last entry is 1, it may be removed.
 * 3) Let h be the length of the last set of hyperion marks. If h > 1:
 * 4) Remove the last entry of the expression and call it r.
 * 5) Again remove the last entry of the expression; this time call it z.
 * 6) Repeat z r times with h - 1 hyperion marks in between each repetition. Append this to the end of the expression. (Restore a removed hyperion mark sequence to glue the two expressions together.)
 * 7) If the last set of hyperion marks is of length one:
 * 8) Evaluate the original expression, but with the last entry decreased by 1. Call this value z.
 * 9) Remove the last two entries of the expression.
 * 10) Add z as an entry to the end of the expression. (Again, restore a removed hyperion mark sequence to glue the two expressions together.)

Examples

 * E(a)#b = (410)^b
 * E(10)6 = E6 = E6#1 =  = million
 * E(10)100 = E100 = E100#1 =  = googol
 * This is an example of rule 1 with a one-entry expressions. Since the base defaults to 10, we can abbreviate E(10)100 as E100.
 * E100#2 = E(E100#1) = E =   = googolplex
 * E100#3 = E(E100#2) = E1010 100 =  = googolduplex
 * This is an example of rule 3 (rule 4 in the expansion) with a two-entry expressions. In the second expression, the parentheses can be omitted: E(E100#1) = EE100#1.
 * E1#100 = EEE...EEE1 (100 E's) = giggol
 * Repeated application of rule 3: E1#100 = EE1#99 = EEE1#98 = ...
 * E100#100 = EEE...EEE100 (100 E's) = grangol
 * This is the same as E1#100, but with a different first entry.
 * E100#101 = EEE...EEE100 (101 E's) = grangolplex
 * E100#101 = EE100#100 =, hence the name.
 * E100#100#2 = E100#(E100#100) = EEE...EEE100 (grangol E's) = grangoldex
 * Now we enter three-entry expressions.
 * E100#100#3 = E100#(E100#100#2) = E100#(E100#(E100#100)) = EEE...EEE100 (grangoldex E's) = grangoldudex
 * Increasing the value of the third entry makes nesting deeper and deeper.
 * E100#100#100#100 = E100#100#(E100#100#100#99) = E100#100#(E100#100#(E100#100#100#98)) = ... gigangol
 * Four-entry expressions are similar &mdash; they create deeper and deeper nesting in the array level below them. This can also be written as E100##4; the beginning of the next level of the notation.
 * E100##100 = E100#100#100#...#100#100#100 with 100 repetitions of 100 = gugold
 * Now we have arrived at Extended Hyper-E Notation. Two successive hyperion marks indicate repetition at the lower level.
 * E100##100#100 = graatagold
 * This expression decomposes into Ea##b expressions by applying rule 4 repeatedly.
 * E100##100##100 = E100##100#100#...#100#100 with 100 repetitions of 100 = gugolthra
 * We ignore the first ## until the second one has been expanded and all the 100s have been solved.
 * E100###100 = E100##100##...##100##100 with 100 repetitions of 100 = throogol
 * Three hyperion marks constitute a repetition of two hyperion marks. Remember, the double marks are solved from right to left.
 * E100####100 = E100###100###...###100###100 with 100 repetitions of 100 = teroogol
 * Quadruple hyperions decompose into triples.
 * Godgahlah = E100#####...#####100 with 100 hyperion marks or E100#100100
 * Sets of 100 hyperion marks decompose into 99s, 99s decompose into 98s, etc.

Pseudocode
For a fixed number of variables, the original Hyper-E Notation is primitive-recursive, although the values it produces are well beyond that of any computer. The extended Hyper-E Notation is nonprimitive-recursive for two variables or more.

function Eb(,, ..., , ): if n = 1: return if = 1: return Eb(,, ..., ) z := Eb(,, ..., , - 1) return Eb(,, ..., , z) function xEb(,, ..., , ;             , , ..., , ): if n = 1: return if = 1: return xEb(,, ..., ;                   , , ..., ) if > 1: r := z := zseq := z, z, ..., z, z (r times) h := hseq := h, h, ..., h, h (r - 1 times) return xEb(,, ..., , zseq;                   , , ..., , hseq) z := xEb(,, ..., - 1;              , , ..., , ) return xEb(,, ..., , z;               , , ..., )