login
A352026
a(n) is the nearest integer to 1/(H(k) - n), where H(k) is the smallest harmonic number that exceeds n.
1
1, 2, 12, 50, 37, 483, 229, 785, 2059, 4806, 23251, 56470, 327690, 813351, 734186, 2643630, 10476269, 67340402, 268822185, 102740092, 618260119, 2491694355, 7222972533, 50525424196, 44010188391, 164490666033, 131444704333, 548839044705, 1808874061272, 9913711133738
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
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
EXTENSIONS
More terms from Peter Luschny, Mar 01 2022
STATUS
approved