login
Least k such that H(k) >= n, where H(k) is the harmonic number Sum_{i=1..k} 1/i.
32

%I #81 Feb 09 2024 10:07:32

%S 0,1,4,11,31,83,227,616,1674,4550,12367,33617,91380,248397,675214,

%T 1835421,4989191,13562027,36865412,100210581,272400600,740461601,

%U 2012783315,5471312310,14872568831,40427833596,109894245429,298723530401,812014744422

%N Least k such that H(k) >= n, where H(k) is the harmonic number Sum_{i=1..k} 1/i.

%D Bruno Rizzi and Cristina Scagliarini: I numeri armonici. Periodico di matematiche, "Mathesis", pp. 17-58, 1986, numbers 1-2. [From _Vincenzo Librandi_, Jan 05 2009]

%D W. Sierpiński, Sur les décompositions de nombres rationnels, Oeuvres Choisies, Académie Polonaise des Sciences, Warsaw, Poland, 1974, p. 181.

%D N. J. A. Sloane, Illustration for sequence M4299 (=A007340) in The Encyclopedia of Integer Sequences (with Simon Plouffe), Academic Press, 1995.

%H T. D. Noe, <a href="/A004080/b004080.txt">Table of n, a(n) for n=0..100</a> (using Hickerson's formula in A002387)

%H John V. Baxley, <a href="http://www.jstor.org/stable/2691241">Euler's constant, Taylor's formula, and slowly converging series</a>, Math. Mag. 65 (1992), 302-313.

%H R. P. Boas, Jr. and J. W. Wrench, Jr., <a href="http://www.jstor.org/stable/2316476">Partial sums of the harmonic series</a>, Amer. Math. Monthly, 78 (1971), 864-870.

%H Keneth Adrian Dagal, <a href="http://arxiv.org/abs/1309.3527">A Lower Bound for tau(n) for k-Multiperfect Number</a>, arXiv:1309.3527 [math.NT], 2013.

%H J. Sondow and E. W. Weisstein, <a href="http://mathworld.wolfram.com/HarmonicNumber.html">MathWorld: Harmonic Number</a>

%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/HarmonicSeries.html">Harmonic Series</a>

%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/High-WaterMark.html">High-Water Mark</a>

%F Limit_{n->oo} a(n+1)/a(n) = exp(1). - _Sébastien Dumortier_, Jun 29 2005

%F a(n) = exp(n - gamma + o(1)). - _Charles R Greathouse IV_, Mar 10 2009

%F a(n) = A002387(n) for n>1. - _Robert G. Wilson v_, Jun 18 2015

%e a(2)=4 because 1/1 + 1/2 + 1/3 + 1/4 > 2.

%t aux[0] = 0; Do[aux[n] = Floor[Floor[Sum[1/i, {i, n}]]]; If[aux[n] > aux[n - 1], Print[n]], {n, 1, 14000}] (* _José María Grau Ribas_, Feb 20 2010 *)

%t a[0] = 0; a[1] = 1; a[n_] := k /. FindRoot[ HarmonicNumber[k] == n, {k, Exp[n - EulerGamma]}, WorkingPrecision -> 50] // Ceiling; Table[a[n], {n, 0, 28}] (* _Jean-François Alcover_, Aug 13 2013, after _Charles R Greathouse IV_ *)

%o (PARI) my(t=0, n=0); for(i=0, 10^20, if (i, t+=1./i); if(t>=n, print1(i, ", "); n++)) \\ Thomas Gettys (tpgettys(AT)comcast.net), Jan 21 2007; corrected by _Michel Marcus_, Jan 19 2022

%o (Haskell)

%o import Data.List (findIndex); import Data.Maybe (fromJust)

%o a004080 n = fromJust $

%o findIndex (fromIntegral n <=) $ scanl (+) 0 $ map recip [1..]

%o -- _Reinhard Zumkeller_, Jul 13 2014

%Y Apart from first two terms, same as A002387.

%K nonn,nice

%O 0,3

%A _N. J. A. Sloane_, _Clark Kimberling_

%E Terms for n >= 13 computed by _Eric W. Weisstein_; corrected by _James R. Buddenhagen_ and _Eric W. Weisstein_, Feb 18 2001

%E Edited by _Dean Hickerson_, Apr 19 2003

%E More terms from _Sébastien Dumortier_, Jun 29 2005

%E a(27) from Thomas Gettys (tpgettys(AT)comcast.net), Dec 05 2006

%E a(28) from Thomas Gettys (tpgettys(AT)comcast.net), Jan 21 2007

%E Edited by _Charles R Greathouse IV_, Mar 24 2010