I can't figure out how to format a variable isomorphic expression in Mathematica so that it will look nice. The best I can do will put parentheses around everything and expand powers. For example, given the array ##\{2,4,4,3,3\}##, I'd like Mathematica to write:(adsbygoogle = window.adsbygoogle || []).push({});

##\mathbb{Z}_2\times\mathbb{Z}_{2^2}\times \mathbb{Z}_{2^2}\times \mathbb{Z}_3\times \mathbb{Z}_3##

but the subscripts and number of them would be variable. This code:

will outputCode (Text):

mySubscripts = {2, 2^4, 2^4, 3, 3};

expression =

SubscriptBox["\[DoubleStruckCapitalZ]", mySubscripts[[1]]] //

DisplayForm;

For[i = 2, i <= Length[mySubscripts], i++,

expression =

expression \[Cross]SubscriptBox["\[DoubleStruckCapitalZ]",

mySubscripts[[i]]] // DisplayForm;

];

Style[expression, 40]

##(((\mathbb{Z}_2\times\mathbb{Z}_{16})\times\mathbb{Z}_{16})\times\mathbb{Z}_3\times\mathbb{Z}_3##. and that's not ok; I need to keep the exponents in their un-expanded format like ##2^2##, and also separate the prime powers and eliminate the parenthesis or preferably, put parenthesis only around like prime powers . Is there anyway to modify my code so that the output will look like the first format? If I try to convert everything to strings, the subscripts are much too low and don't look nice. Basically, my objective is to construct an isomorphic expression like above for variable ##n=p_1^{e_1}p_2^{e_2}\cdots p_n^{e_n}##

Ok thanks for reading,

Jack

**Physics Forums | Science Articles, Homework Help, Discussion**

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# Mathematica Mathematica: unable to format isomorphic expression

Loading...

Similar Threads for Mathematica unable format |
---|

Mathematica Storing Mathematica output |

Mathematica Mathematica to MATLAB |

Mathematica Cannot do the integral of the Hyper-geometric function? |

Mathematica Cannot Plot This Function in Mathematica |

Mathematica While Loop in Mathematica |

**Physics Forums | Science Articles, Homework Help, Discussion**