login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A220114
Largest k >= 0 such that k = n - x - y where n = x*y, x > 0, y > 0, or -1 if no such k exists.
1
-1, -1, -1, 0, -1, 1, -1, 2, 3, 3, -1, 5, -1, 5, 7, 8, -1, 9, -1, 11, 11, 9, -1, 14, 15, 11, 15, 17, -1, 19, -1, 20, 19, 15, 23, 24, -1, 17, 23, 27, -1, 29, -1, 29, 31, 21, -1, 34, 35, 35, 31, 35, -1, 39, 39, 41, 35, 27, -1, 44, -1, 29, 47, 48, 47, 49, -1, 47, 43, 53, -1, 55, -1, 35, 55, 53, 59, 59, -1, 62
OFFSET
1,8
COMMENTS
Any number n can be written as n=1*n, therefore max{ n-x-y; x>0, y>0, x*y=n } >= -1, with equality for prime numbers. - M. F. Hasler, Dec 29 2012
FORMULA
a(n) = n - A063655(n).
a(n) = max { n-x-y ; x>0, y>0, x*y = n }. - M. F. Hasler, Dec 29 2012
EXAMPLE
a(4) = 0 because 4 = 2*2 and 0 = 4 - 2 - 2.
MAPLE
A220114 := proc(n)
local k, x;
k := {-1} ;
for x in numtheory[divisors](n) do
k := k union {n-x-n/x} ;
end do:
return max(op(k)) ;
end proc: # R. J. Mathar, Jan 08 2013
CROSSREFS
Sequence in context: A077941 A077990 A085667 * A334362 A035516 A120428
KEYWORD
sign
AUTHOR
Gerasimov Sergey, Dec 06 2012
EXTENSIONS
Corrected by R. J. Mathar, Jan 08 2013
STATUS
approved