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?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg28236] Re: [mg28229] Re: [mg28180] Automatic expansion of Log[a^n] for a,n explicit positive integers?
  • From: Harald Anlauf <anlauf at hep.tu-darmstadt.de>
  • Date: Fri, 6 Apr 2001 01:52:46 -0400 (EDT)
  • References: <Pine.LNX.4.30.0104051009080.3276-100000@carmen.nikhef.nl>
  • Sender: owner-wri-mathgroup at wolfram.com

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?