MathGroup Archive 2001

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

Search the Archive

Re: Sum of Prime factors

  • To: mathgroup at smc.vnet.net
  • Subject: [mg30829] Re: Sum of Prime factors
  • From: "DIAMOND Mark R." <dot at dot.dot>
  • Date: Thu, 20 Sep 2001 03:51:21 -0400 (EDT)
  • Organization: The University of Western Australia
  • References: <9o98p1$cqi$1@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

Example

In[1]:=
a = FactorInteger[2342342*167]

Out=
{{2, 1}, {167, 2}, {7013, 1}}

In[2]=
b=Map[ (Apply[ Plus, IntegerDigits[ #[[1]]  ] ]* #[[2]] ) &, a]

Out=
{2, 28, 11}

Apply[Plus,b]
41
--
Mark R. Diamond
Send email to  psy dot uwa dot edu dot au and address to markd
http://www.psy.uwa.edu.au/user/markd
"Shyam Sunder Gupta" <cec at cal2.vsnl.net.in> wrote in message
news:9o98p1$cqi$1 at smc.vnet.net...
>
> Can any body help in providing a simple mathematica code for finding sum
> of digits of prime factors(including repetitions) of a number. For
> example 198 =2*3*3*11 , so sum of digits of prime factors=
> 2+3+3+1+1=10.
>
> Shyam Sunder Gupta
> email: guptass at rediffmail.com




  • Prev by Date: export graphics on a Suse Linux 7.0 PC
  • Next by Date: Page preview and graphic size
  • Previous by thread: Re: Sum of Prime factors
  • Next by thread: RE: Sum of Prime factors