OFFSET
0,2
COMMENTS
The k-th harmonic number, H(k), is Sum_{j=1..k} 1/j. A002387(n) is the smallest k such that H(k) > n.
LINKS
Peter Luschny, Table of n, a(n) for n = 0..100
FORMULA
a(n) = round(1/(H(A002387(n)) - n)).
EXAMPLE
H(2) = 1/1 + 1/2 = 3/2 = 1.5;
H(3) = 1/1 + 1/2 + 1/3 = 11/6 = 1.8333...;
H(4) = 1/1 + 1/2 + 1/3 + 1/4 = 25/12 = 2.08333..., which is the first harmonic number that exceeds 2, so a(2) = round(1/(25/12 - 2)) = round(1/(1/12)) = 12.
H(10) = 7381/2520 = 2.92896...;
H(11) = 83711/27720 = 3.01987..., which is the first harmonic number > 3, and the fractional part of 83711/27720 = 551/27720, so a(3) = round(27720/551) = round(50.30852...) = 50.
PROG
(PARI) a(n)={my(s=0, k=0); while(s<=n, k++; s+=1/k); round(1/(s-n))} \\ Andrew Howroyd, Mar 01 2022
(SageMath)
RR = RealField(1000)
def A352026(n):
g = RR.euler_constant()
u = exp(RR(n) - g)
a = u + RR(3/2) - RR(1/(24*u)) + RR(3/(640*u^3))
h = RR(psi(RR(floor(a)))) + g
return round(RR(1/(h - RR(n))))
print([A352026(n) for n in range(30)]) # Peter Luschny, Mar 03 2022
CROSSREFS
KEYWORD
nonn
AUTHOR
Sebastian F. Orellana, Feb 28 2022
EXTENSIONS
More terms from Peter Luschny, Mar 01 2022
STATUS
approved