16 lines
518 B
Text
16 lines
518 B
Text
SumPrimeDivisors[n_] := Total[First /@ FactorInteger[n]]
|
|
RuthAaron[n_] := SumPrimeDivisors[n] == SumPrimeDivisors[n + 1]
|
|
|
|
SumPrimeFactors[n_] :=
|
|
Total[First[#] * Last[#] & /@ FactorInteger[n]]
|
|
RuthAaronFactors[n_] :=
|
|
SumPrimeFactors[n] == SumPrimeFactors[n + 1]
|
|
|
|
RuthAaronSeq := Select[Range[100000], RuthAaron]
|
|
RuthAaronFactorSeq := Select[Range[100000], RuthAaronFactors]
|
|
|
|
Print["30 Ruth Aaron numbers:"]
|
|
Print[Take[RuthAaronSeq, 30]]
|
|
|
|
Print["\n30 Ruth Aaron factor numbers:"]
|
|
Print[Take[RuthAaronFactorSeq, 30]]
|