OFFSET
1,4
COMMENTS
If p is a prime number, then a(p)=0.
EXAMPLE
For n=15, a(15) = 15-2 = 13.
MAPLE
f := proc(n)
option remember:
if isprime(n) then
n
else
procname(convert(numtheory:-factorset(n), `+`))
end if
end proc:
f(1) := 0:
seq(n - f(n), n = 1..100);
PROG
(Python)
from sympy import primefactors
def a(n, pn):
if n == pn:
return n
else:
return a(sum(primefactors(n)), n)
print([i-a(i, None) for i in range(1, 100)])
CROSSREFS
KEYWORD
nonn
AUTHOR
Rafik Khalfi, Aug 18 2024
STATUS
approved