Dynamic MathML using JavaScript
Define <p id="the_digit">
Then use a JavaScript function to write MathML islands into the page using getElementById("the_digit").innerHTML= code
Firefox will render this type of dynamic MathML correctly. Warning! IE and Safari for Windows will not render this type of dynamic MathML correctly.