login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A088685
Records for the sum-of-primes function sopfr(n) if sopfr(prime) is taken to be 0.
5
0, 4, 5, 6, 7, 9, 10, 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
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