TITLE: How is a "computer variable" defined mathematically?
QUESTION [6 upvotes]: Variables used in maths formulae are not the same that those of computing programs. Maths variables can be bound to a given value only once, and then keep that value.
On the other hand, a programming variable is "mutable". It is like a box with a name, to which we can change its value over time.
How can  a mutable programming variable be mathematically defined?

REPLY [2 votes]: Please note that assignment of "computer variables" happens in some programming languages - namely, those of the imperative programming paradigm, such as C or Java. In other programming paradigms this is explicitly forbidden - e.g., functional or logic programming.
In Haskell or Prolog, a statement of the form
x = x + 1

will lead to a compiler error. Variables are immutable, just like those in mathematics. This leads naturally to an emphasis in functions that transform input into output, not in data that is rewritten from input into output. (And many more advantages in the sense of approaching programming to mathematics, such as functions that return always the same output given the same input).
Probably the confusion arises from using the same words in both fields for different things. A variable in programming, as you have noted, is "a box with a name". More formally, it is a reference to an address in memory. What this part of memory holds, we cannot know from the variable - we can know some things, such as its length if it is a typed variable, but not the actual value unless we look at the memory contents.
"Computer variables" could be compared to an index within a vector or matrix. If we regard the memory as a vector $m$, then a variable is its $i$-th element
$$
\overrightarrow{m}_{i}, 0 < i < \left| \overrightarrow{m} \right|
$$
This supposes that all variables need precisely one memory element to be held. This is probably not true, since a double-precision number requires twice the memory as a float. So, a computer variable could be compared to a range of elements within a vector.
$$
[\overrightarrow{m}_{i}, \overrightarrow{m}_{j}] , 0 < i < j < \left| \overrightarrow{m} \right|
$$
You could imagine different states of memory as different vectors $\overrightarrow{m}'$, $\overrightarrow{m}''$ ... Indexing those different vectors at the same indices $i$, $j$ (hence the same "computer variable") would yield different elements each time.