MathGroup Archive 1998

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: FactorInteger

  • To: mathgroup at smc.vnet.net
  • Subject: [mg14439] Re: FactorInteger
  • From: graciark at ippt.gov.pl (Adam Ciarkowski)
  • Date: Wed, 21 Oct 1998 03:32:35 -0400
  • Organization: IPPT PAN
  • References: <70dd3k$230@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

In article <70dd3k$230 at smc.vnet.net>, awhopper at hermes.net.au says...
>
>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
>
Try this:
In[1]:=
facInteger[x_]:=Module[{t}, t=FactorInteger[x]; Apply[Times, 
Table[HoldForm[#1^#2]&[Apply[Sequence, t[[i]]]], {i, Length[t]}]]]

For example:
In[2]:=facInteger[600]
Out[2]= 2^3 3^1 5^2
In[3]:={%[[3]],    %[[3]] // ReleaseHold} Out[3]= {5^2, 25}

Adam
-----------
(remove gr from my e-mail address)



  • Prev by Date: Re: I need some help ...
  • Next by Date: Re: Plot, Cursor and Spelling Errors questions
  • Previous by thread: RE: FactorInteger
  • Next by thread: Re: FactorInteger