# Equations with operations as variables

There are number puzzles which go like this: given 2_2_1=5. Insert operations (addition and multiplication) to make the equation valid. Solution: (+,+) or ($\cdot$,+).

My question is: does anybody know a book or a paper where questions like these are formalized and tackled? To be more specific, does anybody know a reference, where problems like the following are discussed?

Let M be a set and let $O=\{\circ_1,\circ_2,...,\circ_n\}$ be a set of binary operations on M, $\circ_i: M\times M\to M$ for i=1,...,n. Let $A\subset M$ be a finite subset and $b\in M$ be fixed. Does there exist a positive integer $n_0\in\mathbb{N}$ such that for any sequence $\{a_i\}_{i=1}^{n}\in A^{n}$ with $n\geq n_0$ there exists a sequence of operations $\{+_j\}_{j=1}^{n-1}\in O^{n-1}$ such that the equation

$$(...((a_1 +_1 a_2)+_2 a_3)+_3...)+_{n-1} a_n =b$$

holds?

-