OFFSET
2,1
COMMENTS
One of the terms in this sequence is the subject of a problem on the 2013 ARML contest (Team Round).
The Mathematica code below computes the quadruple {x, y, z, a(n)}, where z is as small as possible (in the event of a tie).
LINKS
Peter Kagey, Table of n, a(n) for n = 2..10000
EXAMPLE
For n = 160, a(n) = 50, as 26 * 6 + 4 = 160 and 26 + 6 * 4 = 50 and no triple of positive integers (x, y, z) with xy + z = 160 gives a smaller value for x + yz.
MAPLE
A228286 := proc(n)
local a, x, y, z ;
a := n+n^2 ;
for z from 1 to n-1 do
for x in numtheory[divisors](n-z) do
y := (n-z)/x ;
a := min(a, x+y*z) ;
end do:
end do:
return a;
end proc: # R. J. Mathar, Sep 02 2013
MATHEMATICA
a[n_] := Module[{X, bX, bT, m},
bT = n + 1;
bX = {n - 1, 1, 1, n};
X = bX;
m = Floor[2*Sqrt[X[[3]]*(n - X[[3]])]];
While[bT >= m && X[[3]] <= n/2,
X[[2]] = Max[1, Floor[(n - bX[[3]])/bT]];
While[X[[2]] <= Floor[bT/X[[3]]],
If[Mod[n - X[[3]], X[[2]]] == 0,
X[[1]] = (n - X[[3]])/X[[2]];
X[[4]] = X[[1]] + X[[2]]*X[[3]];
If[X[[4]] < bX[[4]], bX = X]];
X[[2]] = X[[2]] + 1];
X[[3]] = X[[3]] + 1;
m = Floor[2*Sqrt[X[[3]]*(n - X[[3]])]]];
Return[bX]]; Table[a[n][[-1]], {n, 2, 100}]
CROSSREFS
KEYWORD
nonn,look
AUTHOR
Andy Niedermaier, Aug 19 2013
STATUS
approved