MathGroup Archive 2001

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

Search the Archive

Re: Sum of Prime factors

  • To: mathgroup at smc.vnet.net
  • Subject: [mg30854] Re: Sum of Prime factors
  • From: "Orestis Vantzos" <atelesforos at hotmail.com>
  • Date: Thu, 20 Sep 2001 03:52:03 -0400 (EDT)
  • Organization: National Technical University of Athens, Greece
  • References: <9o98p1$cqi$1@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

sumOfDigits[i_] :=
  Plus @@ (FactorInteger[i] /. {n_Integer, m_Integer} :>
          m Plus @@ IntegerDigits[n])
will do the job..
Interesting graph if you apply ListPlot to something like
sumOfDigits/@Range[1000].
Orestis

"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: Re: Preserve natural number "e" using N or SetPrecision
  • Next by Date: export graphics on a Suse Linux 7.0 PC
  • Previous by thread: Re: Sum of Prime factors
  • Next by thread: Re: Sum of Prime factors