%I #62 Sep 08 2021 21:14:02
%S 3,10,21,35,53,74,99,128,160,196,235,277,324,374,427,484,545,609,676,
%T 748,822,901,983,1068,1157,1250,1346,1446,1549,1656,1766,1880,1998,
%U 2119,2244,2372,2504,2639,2778,2921,3067,3216,3369,3526,3686,3850,4018,4189
%N a(n) is the greatest m such that 2*H(n) > H(m), where H(n) is the n-th harmonic number.
%H Jon E. Schoenfield, <a href="/A289183/b289183.txt">Table of n, a(n) for n = 1..10000</a>
%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/HarmonicNumber.html">Harmonic Number</a>
%F From _Jon E. Schoenfield_, Jul 13 2017: (Start)
%F It seems that, for the vast majority of values of n > 1, f(n) = floor(n^2 * exp(gamma + 1/n) - C), where gamma is the Euler-Mascheroni constant (A001620) and C = 1/2 + (1/6)*exp(gamma) = 0.7968454029983663308727506838511965915282742..., is equal to a(n); f(n) = a(n) for all n in [2..10000] except n=66: f(66)=7876, but a(66)=7875. [Thanks to _Vaclav Kotesovec_ for identifying the value of C.]
%F Is there any n > 66 at which f(n) and a(n) differ?
%F (End)
%F From _Vaclav Kotesovec_, Jul 17 2017: (Start)
%F f(39087) = 2721180603, but a(39087) = 2721180602;
%F f(517345) = 476697560917, but a(517345) = 476697560916;
%F f(2013005) = 7217245877275, but a(2013005) = 7217245877274;
%F No other such numbers below 10000000.
%F (End)
%F After 2013005, the only other numbers n < 4*10^9 at which f(n) and a(n) differ are 10240491 and 80968833. - _Jon E. Schoenfield_, Aug 05 2017
%t s = HarmonicNumber@ Range[10^4]; Table[Position[s, k_ /; k < 2 HarmonicNumber@ n][[-1, 1]], {n, 48}] (* _Michael De Vlieger_, Jun 27 2017 *)
%t (* The following program searches for such n that f(n) <> a(n) *)
%t f[n_] := Floor[n^2*E^(EulerGamma + 1/n) - (1/2 + (1/6)*E^(EulerGamma))];
%t harmonic[n_] := Log[n] + EulerGamma + 1/(2 n) - Sum[BernoulliB[2 k]/(2 k*n^(2 k)), {k, 1, 10}];
%t Select[Range[100000], 2*harmonic[#] < harmonic[f[#]] &]
%t (* _Vaclav Kotesovec_, Jul 17 2017 *)
%o (PARI) a(n) = {my(m=1); hn = sum(k=1, n, 1/k); hm = 1; until(hm > 2*hn, m++; hm+=1/m); m--;} \\ _Michel Marcus_, Jul 19 2017
%o (Python)
%o from sympy import harmonic
%o def a(n):
%o hn2 = 2 * harmonic(n)
%o m = n
%o while harmonic(m) <= hn2: m += 1
%o return m - 1
%o print([a(n) for n in range(1, 49)]) # _Michael S. Branicky_, Mar 10 2021
%Y Cf. A000217, A002387, A002805, A092315.
%K nonn
%O 1,1
%A _Joseph Wheat_, Jun 27 2017
%E More terms from _Michael De Vlieger_, Jun 27 2017