OFFSET
1,2
COMMENTS
A048974, A052147 and A067187 are very similar after dropping terms less than 13. - Eric W. Weisstein, Oct 10 2003
LINKS
Eric Weisstein's World of Mathematics, Sum of Prime Factors
MATHEMATICA
Union@ FoldList[Max, Table[Total@ Flatten@ Map[ConstantArray[#1, #2] /. 1 -> 0 & @@ # &, FactorInteger@ n] - n Boole[PrimeQ@ n], {n, 540}]] (* Michael De Vlieger, Jun 29 2017 *)
PROG
(PARI) sopfr(k) = my(f=factor(k)); sum(j=1, #f~, f[j, 1]*f[j, 2]);
lista(nn) = {my(record = -1); for (n=1, nn, if (! isprime(n), if ((x=sopfr(n)) > record, record = x; print1(record, ", ")); ); ); } \\ Michel Marcus, Jun 29 2017
(Python)
from sympy import factorint, isprime
def sopfr(n):
f=factorint(n)
return sum([i*f[i] for i in f])
l=[]
record=-1
for n in range(1, 501):
if not isprime(n):
x=sopfr(n)
if x>record:
record=x
l.append(record)
print(l) # Indranil Ghosh, Jun 29 2017
CROSSREFS
KEYWORD
nonn
AUTHOR
Eric W. Weisstein, Oct 05 2003
STATUS
approved