MathGroup Archive 2001

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

Search the Archive

Re: Sum of Prime factors

  • To: mathgroup at smc.vnet.net
  • Subject: [mg30833] Re: [mg30809] Sum of Prime factors
  • From: Ken Levasseur <Kenneth_Levasseur at uml.edu>
  • Date: Thu, 20 Sep 2001 03:51:26 -0400 (EDT)
  • References: <200109190416.AAA12694@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

Shyam:


Here is function that will do what you wnat:

In[33]:=
DigitSumOfFactors = (FactorInteger[#] //
                         (# /. {a_?IntegerQ, b_?IntegerQ} :> 
Table[IntegerDigits[a], {b}]) & //
                         Flatten //
                         (Plus @@ #) &) &;

In[34]:=
DigitSumOfFactors[55]

Out[34]=
7

In[35]:=
                    3
DigitSumOfFactors[13 ]

Out[35]=
12

Ken Levasseur
Math. Sciences
UMass Lowell

Shyam Sunder Gupta wrote:

>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: Page preview and graphic size
  • Next by Date: Re: Numbered equations
  • Previous by thread: Sum of Prime factors
  • Next by thread: Re: Sum of Prime factors