OFFSET
2,1
EXAMPLE
a(9) = 0 since the prime factors are 3 and 3, and 3 - 3 = 0.
a(11) = 11 since the only prime factor of 11 is 11, and 11 - 0 = 11.
a(24) = -3 since the prime factors of 24 are 2, 2, 2, and 3, and 3 - (2 + 2 + 2) = -3.
MATHEMATICA
Table[a=Flatten[Table@@@FactorInteger[k]]; Last@a-Total@Most@a, {k, 2, 100}] (* Giorgos Kalogeropoulos, Mar 31 2021 *)
PROG
(Python)
from sympy import factorint
def a(n): f = factorint(n); return 2*max(f) - sum(p*f[p] for p in f)
print([a(n) for n in range(2, 74)]) # Michael S. Branicky, Mar 23 2021
(PARI) a(n) = my(f=factor(n)); 2*vecmax(f[, 1]) - sum(k=1, #f~, f[k, 1]*f[k, 2]); \\ Michel Marcus, Mar 31 2021
CROSSREFS
KEYWORD
sign
AUTHOR
Elam Blackwell, Mar 14 2021
STATUS
approved