cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A289183 a(n) is the greatest m such that 2*H(n) > H(m), where H(n) is the n-th harmonic number.

Original entry on oeis.org

3, 10, 21, 35, 53, 74, 99, 128, 160, 196, 235, 277, 324, 374, 427, 484, 545, 609, 676, 748, 822, 901, 983, 1068, 1157, 1250, 1346, 1446, 1549, 1656, 1766, 1880, 1998, 2119, 2244, 2372, 2504, 2639, 2778, 2921, 3067, 3216, 3369, 3526, 3686, 3850, 4018, 4189
Offset: 1

Views

Author

Joseph Wheat, Jun 27 2017

Keywords

Crossrefs

Programs

  • Mathematica
    s = HarmonicNumber@ Range[10^4]; Table[Position[s, k_ /; k < 2 HarmonicNumber@ n][[-1, 1]], {n, 48}] (* Michael De Vlieger, Jun 27 2017 *)
    (* The following program searches for such n that f(n) <> a(n) *)
    f[n_] := Floor[n^2*E^(EulerGamma + 1/n) - (1/2 + (1/6)*E^(EulerGamma))];
    harmonic[n_] := Log[n] + EulerGamma + 1/(2 n) - Sum[BernoulliB[2 k]/(2 k*n^(2 k)), {k, 1, 10}];
    Select[Range[100000], 2*harmonic[#] < harmonic[f[#]] &]
    (* Vaclav Kotesovec, Jul 17 2017 *)
  • 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
    
  • Python
    from sympy import harmonic
    def a(n):
      hn2 = 2 * harmonic(n)
      m = n
      while harmonic(m) <= hn2: m += 1
      return m - 1
    print([a(n) for n in range(1, 49)]) # Michael S. Branicky, Mar 10 2021

Formula

From Jon E. Schoenfield, Jul 13 2017: (Start)
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.]
Is there any n > 66 at which f(n) and a(n) differ?
(End)
From Vaclav Kotesovec, Jul 17 2017: (Start)
f(39087) = 2721180603, but a(39087) = 2721180602;
f(517345) = 476697560917, but a(517345) = 476697560916;
f(2013005) = 7217245877275, but a(2013005) = 7217245877274;
No other such numbers below 10000000.
(End)
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

Extensions

More terms from Michael De Vlieger, Jun 27 2017