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.

Examples

 * Ea = 10a
 * E100 = 10100 = googol (a = 100 on above equation)
 * Ea#b = EEE...Ea w/b E's = (with b 10's)
 * E(3)a#b = (with b 3's)
 * E100#100 = grangol
 * Ea#b#c = Ea#(Ea#(Ea#(Ea#(...(Ea#b)...)) (with c Ea's)
 * E100#100#100 = greagol
 * Ea#b#c#d = Ea#b#(Ea#b#(Ea#b#(Ea#b#(...(Ea#b#c)...)) (with d Ea's)

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 the rest of the array.

The difference between original and extended notation is that extended Hyper-E notation allows more than one consecutive #'s.


 * Rule 1. If there are no hyperions:
 * \(E(b)x = b^x\).
 * Rule 2. If the last entry is 1:
 * \(E(b) @ \#^{h(n-1)}{a_n}\#^{h(n)}1 = E(b) @ \#^{h(n-1)}{a_n}\).
 * Rule 3. If \(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. Otherwise:
 * \(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})\) (note \(\#^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

 * a##b = a#a#a#...a#a with b a#'s
 * a###b = a##a##...a##a##a with b a##'s
 * a####b = a###a###...a###a###a with b a###'s
 * etc.
 * a#bc = a###...##c with b #'s

Examples

 * 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.
 * E303#1 = E303 = eceton = centillion = 10303
 * E303#2 = ecetonplex = EE303 = 1010 303
 * E303#3 = EEE303 = 1010 10 303 = ecetonduplex
 * E1#3 = EEE1 = 1010 10 1 = trialogue
 * E1#4 = EEEE1 = 1010 10 10 = tetralogue
 * E303#6 = EEEEEE303 = 1010 10 10 10 10 303    = ecetonquintiplex
 * 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. Also note that the superscript 100 means that there are 100 #'s; it is not equal to E100#(100100).

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;               , , ..., )