Sum of Prime Factors

Author

Eric W. Weisstein
February 17, 2005

This notebook downloaded from http://mathworld.wolfram.com/notebooks/PrimeNumbers/SumofPrimeFactors.nb.

For more information, see Eric's MathWorld entry http://mathworld.wolfram.com/SumofPrimeFactors.html.

©2005 Wolfram Research, Inc. except for portions noted otherwise

Code

sopfr[n_]:=Plus@@Flatten[Table[#1,{#2}]&@@@FactorInteger[n]]
sopf[n_]:=Plus@@(First/@FactorInteger[n])

Sum of Primes

<<Utilities`Plot`

IntegerListPlot[sopfr/@Range[100],
AxesLabel->TraditionalForm/@{n,HoldForm[sopfr[n]]}]

Sequence

sopf

l=sopf/@Range[50]

sopfr

l=sopfr/@Range[50]

HighWaterMarks[l]

sopfr Excluding Primes

l=If[PrimeQ[#],0,sopfr[#]]&/@Range[500];

Union[Map[Last[IntegerDigits[#]]&,Transpose[HighWaterMarks[l]],{2}]]

Union[Map[Last[IntegerDigits[#]]&,
Drop[Transpose[HighWaterMarks[l]],7],{2}]]

Transpose[HighWaterMarks[l]]//TableForm

HighWaterMarks[l]

ID Number: A048974
URL:       http://www.research.att.com/projects/OEIS?Anum=A048974
Sequence:  5,7,9,13,15,19,21,25,31,33,39,43,45,49,55,61,63,69,73,75,81,
           85,91,99,103,105,109,111,115,129,133,139,141,151,153,159,
           165,169,175,181,183,193,195,199,201,213,225,229,231,235,241,
           243,253,259
Name:      Odd numbers that are the sum of 2 primes.
Formula:   One of the primes must be 2, so this is simply the odd primes + 2.
See also:  Cf. A014092.
           Sequence in context: A075329 A005427 A047478 this_sequence A050550
              A079523 A039504
           Adjacent sequences: A048971 A048972 A048973 this_sequence A048975
              A048976 A048977
Keywords:  nonn,easy
Offset:    1
Author(s): njas
Show internal format for above sequence?

ID Number: A052147
URL:       http://www.research.att.com/projects/OEIS?Anum=A052147
Sequence:  4,5,7,9,13,15,19,21,25,31,33,39,43,45,49,55,61,63,69,73,75,
           81,85,91,99,103,105,109,111,115,129,133,139,141,151,153,159,
           165,169,175,181,183,193,195,199,201,213,225,229,231,235,241,
           243,253,259
Name:      Prime(n) + 2.
See also:  Sequence in context: A035255 A047493 A032360 this_sequence A035266
              A035264 A047259
           Adjacent sequences: A052144 A052145 A052146 this_sequence A052148
              A052149 A052150
Keywords:  nonn
Offset:    1
Author(s): Simon Colton (simonco(AT)cs.york.ac.uk), Jan 24 2000
Show internal format for above sequence?

ID Number: A067187
URL:       http://www.research.att.com/projects/OEIS?Anum=A067187
Sequence:  4,5,6,7,8,9,12,13,15,19,21,25,31,33,39,43,45,49,55,61,63,69,
           73,75,81,85,91,99,103,105,109,111,115,129,133,139,141,151,
           153,159,165,169,175,181,183,193,195,199,201,213,225,229,231,
           235,241,243,253,259,265,271
Name:      Numbers which can be expressed as the sum of two primes in exactly one
              way.
Comments:  All primes + 2 are terms of this sequence. Is 12 the last even term? - Frank
              Ellermann (f-e(AT)hamburg.de), Jan 17, 2002
Links:     Index entries for sequences related to Goldbach conjecture
Example:   4 is a term as 4 = 2+2, 15 is a term as 15 = 13+2.
See also:  Cf. A023036, A067188-A067191, A066722, A045917, A061358.
           Sequence in context: A016070 A047569 A039062 this_sequence A084991
              A065342 A076597
           Adjacent sequences: A067184 A067185 A067186 this_sequence A067188
              A067189 A067190
Keywords:  nonn
Offset:    1
Author(s): Amarnath Murthy (amarnath_murthy(AT)yahoo.com), Jan 10 2002
Extension: Edited by Frank Ellermann (f-e(AT)hamburg.de), Jan 17, 2002
Show internal format for above sequence?

Fixed Points by iterating spf(n)

Table[FixedPointList[sopfr,n],{n,20}]

Table[FixedPoint[sopfr,n],{n,20}]

ID Number: A029908

Table[Most[FixedPointList[sopfr,n]],{n,20}]

Length/@Table[Most[FixedPointList[sopfr,n]],{n,20}]

A002217 (Formerly M0150)

Sum of Terms in Iteration List equals n

Table[Take[FixedPointList[sopfr,n],{2,-2}],{n,20}]

Position[
Table[Plus@@Take[FixedPointList[sopfr,n],{2,-2}]==n,{n,10^5}],True]//Flatten//Timing

Position[
Table[Plus@@Take[FixedPointList[sopfr,n],{2,-2}]==n,{n,10^6}],True]//Flatten//Timing