[go: up one dir, main page]

login
A368784
a(0) = 1. For n > 0, a(n) is the smallest integer k > n such that (Sum_{i = 1..n} i)/(Sum_{i = n + 1..k} i) < 1/n.
1
1, 2, 4, 7, 10, 13, 17, 21, 25, 30, 35, 40, 45, 50, 56, 62, 68, 74, 81, 87, 94, 101, 108, 115, 122, 130, 138, 145, 153, 162, 170, 178, 187, 195, 204, 213, 222, 231, 240, 250, 259, 269, 279, 289, 298, 309, 319, 329, 339, 350, 361, 371, 382, 393, 404, 415, 427, 438
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.
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
A368784 := n -> floor(-1/2 + 1/2*sqrt(4*n^3 + 8*n^2 + 4*n + 1)) + 1;
seq(A368784(n), n = 0 .. 57);
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