Re: FactorInteger
- To: mathgroup at smc.vnet.net
- Subject: [mg14423] Re: [mg14412] FactorInteger
- From: "Carl K.Woll" <carlw at fermi.phys.washington.edu>
- Date: Wed, 21 Oct 1998 03:32:20 -0400
- Organization: Department of Physics
- References: <199810181910.PAA02330@smc.vnet.net.>
- Sender: owner-wri-mathgroup at wolfram.com
Hi Alan, One idea is to use HoldForm. For example, HoldForm[2^2 3^3] displays as 2^2 3^3 Thus, one could make a function, called HoldFactorInteger, as in the following: HoldFactorInteger[a_Integer]:= Apply[Times,Apply[Power,HoldForm[Evaluate[FactorInteger[a]]],{2}],1] The idea of the function is to wrap HoldForm around the output of FactorInteger, but without the Evaluate, the FactorInteger function won't evaluate. The output of FactorInteger is a list of lists, so the Apply function replaces the inner lists with Power and the outer list with Power. Carl Woll Dept of Physics U of Washington awhopper at hermes.net.au wrote: > Dear Math Group, > > Concerning the Prime Factors of composite integers ; > > e.g; > > In[1] := 2^4 3^3 4^2 > > Out[2] = 6912 > > In[3] := FactorInteger[%] > > Out[4] = {{2,4},{3,3},{4,2}} > > In Mathematica 3.0 is there anyway the output of FactorInteger can be > modified to produce the unevaluated prime factors in the usual > exponential form ? > > regards, > > Alan Hopper > Katoomba, Australia > awhopper at hermes.net.au
- References:
- FactorInteger
- From: awhopper@hermes.net.au
- FactorInteger