|
|
A088686
|
|
Positions of the records in the sum-of-primes function sopfr(n) if sopfr(prime) is taken to be 0.
|
|
3
|
|
|
1, 4, 6, 8, 10, 14, 21, 22, 26, 34, 38, 46, 58, 62, 74, 82, 86, 94, 106, 118, 122, 134, 142, 146, 158, 166, 178, 194, 202, 206, 214, 218, 226, 254, 262, 274, 278, 298, 302, 314, 326, 334, 346, 358, 362, 382, 386, 394, 398, 422, 446, 454, 458, 466, 478, 482
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,2
|
|
LINKS
|
|
|
MATHEMATICA
|
Function[s, Map[FirstPosition[s, #][[1]] &, Union@ FoldList[Max, s]] ]@ Table[Total@ Flatten@ Map[ConstantArray[#1, #2] /. 1 -> 0 & @@ # &, FactorInteger@ n] - n Boole[PrimeQ@ n], {n, 500}] (* 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(n, ", ")); ); ); } \\ 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(n)
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|