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.

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

Original entry on oeis.org

0, 1, 4, 11, 31, 83, 227, 616, 1674, 4550, 12367, 33617, 91380, 248397, 675214, 1835421, 4989191, 13562027, 36865412, 100210581, 272400600, 740461601, 2012783315, 5471312310, 14872568831, 40427833596, 109894245429, 298723530401, 812014744422
Offset: 0

Views

Author

Keywords

Examples

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

References

  • 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]
  • W. Sierpiński, Sur les décompositions de nombres rationnels, Oeuvres Choisies, Académie Polonaise des Sciences, Warsaw, Poland, 1974, p. 181.
  • N. J. A. Sloane, Illustration for sequence M4299 (=A007340) in The Encyclopedia of Integer Sequences (with Simon Plouffe), Academic Press, 1995.

Crossrefs

Apart from first two terms, same as A002387.

Programs

  • Haskell
    import Data.List (findIndex); import Data.Maybe (fromJust)
    a004080 n = fromJust $
       findIndex (fromIntegral n <=) $ scanl (+) 0 $ map recip [1..]
    -- Reinhard Zumkeller, Jul 13 2014
  • Mathematica
    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 *)
    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 *)
  • 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
    

Formula

Limit_{n->oo} a(n+1)/a(n) = exp(1). - Sébastien Dumortier, Jun 29 2005
a(n) = exp(n - gamma + o(1)). - Charles R Greathouse IV, Mar 10 2009
a(n) = A002387(n) for n>1. - Robert G. Wilson v, Jun 18 2015

Extensions

Terms for n >= 13 computed by Eric W. Weisstein; corrected by James R. Buddenhagen and Eric W. Weisstein, Feb 18 2001
Edited by Dean Hickerson, Apr 19 2003
More terms from Sébastien Dumortier, Jun 29 2005
a(27) from Thomas Gettys (tpgettys(AT)comcast.net), Dec 05 2006
a(28) from Thomas Gettys (tpgettys(AT)comcast.net), Jan 21 2007
Edited by Charles R Greathouse IV, Mar 24 2010