User blog comment:Hyp cos/R function II/@comment-2033667-20150406074146/@comment-2033667-20150406160538

Okay, take two:


 * A term is an ordered list of one or more numeric terms or bracketed terms.


 * A numeric term is simply a nonnegative integer.


 * A bracketed term consists of a left brace "{", followed by a term, followed by a superscript "+m" where m is a nonnegative integer, and finally a right brace "}". Given a bracketed term B, we will call the term between the braces the contents of B, and the value of m its m-value.


 * A bracketed term is a separator iff its m-value is positive, and a nonseparator otherwise.


 * Next we define well-formedness for the various types of terms. A numeric term is considered well-formed. A bracketed term is well-formed iff its contents do not start nor end with a separator. A list term is considered well-formed iff all its elements are well-formed, and no two consecutive elements are separators.


 * A valid R-expression, then, is a well-formed term. The R-function is denoted nRS where n is a positive integer and S is a valid R-expression.

Your rules say nothing about two consecutive numbers...is that legal? Can we have nR00?