OFFSET
1,2
COMMENTS
A divisor of n other than 1 or n is called nontrivial.
LINKS
Ridouane Oudra, Table of n, a(n) for n = 1..10000
FORMULA
EXAMPLE
There are two ways to write 12 as a product of two nontrivial divisors, i.e., 6*2 and 4*3. Since 8=6+2>4+3=7, we have a(12)=7.
MAPLE
with(numtheory): a:=proc(n) if n=1 then 1; elif isprime(n)=true then n; else min(seq(d+n/d, d in divisors(n) minus{1, n})); fi; end: seq(a(n), n=1..100); # Ridouane Oudra, May 24 2025
MATHEMATICA
Table[If[Length[Divisors[n]] > 2, Min[Table[Divisors[n][[j]] + n/Divisors[n][[j]], {j, 2, Length[Divisors[n]] - 1}]], n], {n, 1, 100}] (* Stefan Steinerberger, Feb 04 2008 *)
PROG
(PARI) a(n) = {my(d = divisors(n)); if(#d > 2, d[ceil((#d+1)/2)] + d[ceil((#d)/2)], n)} \\ David A. Corneth, May 24 2025
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Joseph L. Pe, Feb 01 2008
EXTENSIONS
More terms from Stefan Steinerberger, Feb 04 2008
STATUS
approved
