PROJECT EULER · #0909
L-expressions I
An L-expression is defined as any one of the following:
- a natural number;
- the symbol
; - the symbol
; - the symbol
; - a pair of L-expressions
, which is written as .
An L-expression can be transformed according to the following rules:
for any natural number ; for any L-expressions ; for any L-expressions .
For example, after applying all possible rules, the L-expression
Find the result of the L-expression
Note: it can be proved that the L-expression in question can only be transformed a finite number of times, and the final result does not depend on the order of the transformations.
Write-up coming later
The complete problem is available here. An approach, code, and answer will be added later.