OFFSET
0,2
COMMENTS
(Sum_{i = 1..n} i)/(Sum_{i = n + 1..k} i) = n*(n + 1)/((k - n)*(n + 1 + k)) < 1/n. It follows that k > -1/2 + sqrt(4*n^3 + 8*n^2 + 4*n + 1)/2.
LINKS
Felix Huber, Table of n, a(n) for n = 0..10000
FORMULA
a(n) = floor(-1/2 + sqrt(4*n^3 + 8*n^2 + 4*n + 1)/2) + 1.
a(n) = round(sqrt(n*(n+1)^2 + 1/4)). - Chai Wah Wu, Mar 11 2024
EXAMPLE
a(3) = 7, because (1 + 2 + 3)/(4 + 5 + 6 + 7) = 3/11 < 1/3 and (1 + 2 + 3)/(4 + 5 + 6) = 2/5 > 1/3.
MAPLE
MATHEMATICA
a[n_]:= Floor[-1/2 + Sqrt[4*n^3 + 8*n^2 + 4*n + 1]/2] + 1; Array[a, 58, 0] (* Stefano Spezia, Feb 17 2024 *)
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Felix Huber, Feb 15 2024
STATUS
approved