OFFSET
1,1
COMMENTS
In general, if r > 0 and n > 1, then a(n) is the number k such that h(k) <= r + h(n-1) < h(k+1), where h(m) = m-th harmonic number. Since h(n) is approximately g + log(n+1/2), where g = Euler-Mascheroni constant (A001620), it is easy to prove that a(n) or a(n)-1 is the number floor[n*e^r-(1+e^r)/2]. Thus, the difference sequence of (a(n)) has at most two distinct numbers. For r = 2, the two numbers are 7 and 8.
EXAMPLE
a(2) = 10 because 1/2 + 1/3 +...+ 1/10 < 2 < 1/2 + 1/3 +...+ 1/11.
MATHEMATICA
r = 2; h[n_] := HarmonicNumber[n];
a[n_] : = Select[Range[500], h[#] <= r + h[n - 1] < h[# + 1] & ]
Flatten[Table[a[n], {n, 1, 70}]]
PROG
(Python)
from itertools import accumulate, count
from fractions import Fraction
def A363993(n): return next(x[0]+n-1 for x in enumerate(accumulate(Fraction(1, k) for k in count(n))) if x[1] >= 2) # Chai Wah Wu, Sep 07 2023
(PARI) a(n) = my(k=0); while (sum(i=n, n+k, 1/i) < 2, k++); n+k-1; \\ Michel Marcus, Sep 08 2023
CROSSREFS
KEYWORD
nonn
AUTHOR
Clark Kimberling, Sep 06 2023
STATUS
approved