MathGroup Archive 2001

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

Search the Archive

Re: Re: Automatic expansion of Log[a^n] for a,n explicit positive integers?


Hi,

thanks for your suggestions and help!

I also received a very clever and general solution by
Erich Mueller <emuelle1 at uiuc.edu>:

<quote>

How about implementing the rule using pattern substitution, like this:

Log[12] + Log[x] /. 
  Log[a_Integer] :> Plus @@ (#2Log[#1] & @@ # & /@ FactorInteger[a])

Which returns

2 Log[2] + Log[3] + Log[x]

</quote>

Mianlai's solution has its own advantages, as no explicit substitution is
required.  I may reconsider it when needed.

Again, many thanks for your answers.

Regards,
-Harald


  • Prev by Date: Re: Special Matrix
  • Next by Date: Re: Polar Grids in Mathematica
  • Previous by thread: Operations Research 2.0
  • Next by thread: Re: Re: Automatic expansion of Log[a^n] for a,n explicit positive integers?