Problem Archive

An L-expression is defined as any one of the following:

An L-expression can be transformed according to the following rules:

For example, after applying all possible rules, the L-expression $S(Z)(A)(0)$ is transformed to the number $1$: $$S(Z)(A)(0) \to A(Z(A)(0)) \to A(0) \to 1.$$ Similarly, the L-expression $S(S)(S(S))(S(Z))(A)(0)$ is transformed to the number $6$ after applying all possible rules.

Define the following L-expressions:

For natural numbers $a, b, c, d, e$, let $F(a, b, c, d, e)$ denote the result of the L-expression $D_a(D_b)(D_c)(C_d)(A)(e)$ after applying all possible rules.

Find the last nine digits of $F(12, 345678, 9012345, 678, 90)$.

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.

Solution
No solution yet. Write yours at solutions/s910.md.
Problems sourced from Project Euler · Non-commercial & educational use only · CC BY-NC-SA 4.0