I would like to format the output. For example, the following code gives
For[n=2,n<=10,n++, factorization =FactorInteger[n]; length=Length[factorization]; If[length==1, factorization =(Superscript@@@FactorInteger[n])[], factorization =CenterDot@@(Superscript@@@FactorInteger[n]) ]; Print["n = ", n, " = ", factorization, ", number of prime factors = ", length]; ]
But what I want is something similar to the following (but better alignment)
I know there is Grid, but I don't know how to use them in this current case. Also, I prefer a simpler solution (if there is), such as one can specify a "field width" like in the C language.