PROJECT EULER · #0910
L-expressions II
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
Define the following L-expressions:
; for ; .
For natural numbers
Find the last nine digits of
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.