I am looking for the simplest way to avoid applying Cross
to a single argument.
PrimeFactorization[x_] := Cross @@ (Superscript @@@ FactorInteger[x]);
Table[{n, PrimeFactorization[n]}, {n, 200, 250}] // TableForm
Answer
Since you already use Cross
in a way that it's not meant to be used, you can also redefine it and assign a meaning to it when it has only a single argument:
Unprotect[Cross];
Cross[x_] := x;
A bit less severe: Define your own function.
cross[x__] := Cross[x];
cross[x_] := x;
Comments
Post a Comment