%I #25 May 06 2021 09:44:08
%S 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,
%T 85,91,99,103,105,109,111,115,129,133,139,141,151,153,159,165,169,175,
%U 181,183,193,195,199,201,213,225,229,231,235,241,243,253,259,265,271
%N Records for the sum-of-primes function sopfr(n) if sopfr(prime) is taken to be 0.
%C A048974, A052147 and A067187 are very similar after dropping terms less than 13. - _Eric W. Weisstein_, Oct 10 2003
%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/SumofPrimeFactors.html">Sum of Prime Factors</a>
%t 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 *)
%o (PARI) sopfr(k) = my(f=factor(k)); sum(j=1, #f~, f[j, 1]*f[j, 2]);
%o 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
%o (Python)
%o from sympy import factorint, isprime
%o def sopfr(n):
%o f=factorint(n)
%o return sum([i*f[i] for i in f])
%o l=[]
%o record=-1
%o for n in range(1, 501):
%o if not isprime(n):
%o x=sopfr(n)
%o if x>record:
%o record=x
%o l.append(record)
%o print(l) # _Indranil Ghosh_, Jun 29 2017
%Y Cf. A001414, A048974, A052147, A067187, A088686.
%K nonn
%O 1,2
%A _Eric W. Weisstein_, Oct 05 2003
|