OFFSET
3,2
COMMENTS
a(n) is bounded between n/3 and n/2.
The smallest integer with 2 (instead of 3) divisors that sum to n is given by A060681.
FORMULA
a(2^k) = 2^(k-1).
If n is not a power of 2, a(n) = n*(p-1)/(2p), where p is the smallest odd prime dividing n.
EXAMPLE
a(6) = 2 as one can have 2+2+2 = 6.
a(55) = 22 as one can have 11+22+22 = 55.
MAPLE
f:= proc(n) local P, p;
P:= numtheory:-factorset(n) minus {2};
if P = {} then return n/2 fi;
p:= min(P);
n*(p-1)/(2*p)
end proc:
map(f, [$3..100]); # Robert Israel, May 01 2023
PROG
(SageMath)
def a(n):
F = list(factor(n))
if F[0][0] == 2:
if len(F) == 1:
return n / 2
del F[0]
m = F[0][0]
return n * (m - 1) / (2 * m)
(Python)
from sympy import primefactors
def A362739(n): return n>>1 if (m:=n&-n)==n else n*((p:=min(primefactors(n//m)))-1)//p>>1 # Chai Wah Wu, Jun 21 2023
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Kyan Cheung, May 01 2023
STATUS
approved