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.
%I A001008 M2885 N1157 #357 Jun 26 2025 10:51:51 %S A001008 1,3,11,25,137,49,363,761,7129,7381,83711,86021,1145993,1171733, %T A001008 1195757,2436559,42142223,14274301,275295799,55835135,18858053, %U A001008 19093197,444316699,1347822955,34052522467,34395742267,312536252003,315404588903,9227046511387 %N A001008 a(n) = numerator of harmonic number H(n) = Sum_{i=1..n} 1/i. %C A001008 H(n)/2 is the maximal distance that a stack of n cards can project beyond the edge of a table without toppling. %C A001008 By Wolstenholme's theorem, p^2 divides a(p-1) for all primes p > 3. %C A001008 From _Alexander Adamchuk_, Dec 11 2006: (Start) %C A001008 p divides a(p^2-1) for all primes p > 3. %C A001008 p divides a((p-1)/2) for primes p in A001220. %C A001008 p divides a((p+1)/2) or a((p-3)/2) for primes p in A125854. %C A001008 a(n) is prime for n in A056903. Corresponding primes are given by A067657. (End) %C A001008 a(n+1) is the numerator of the polynomial A[1, n](1) where the polynomial A[genus 1, level n](m) is defined to be Sum_{d = 1..n - 1} m^(n - d)/d. (See the Mathematica procedure generating A[1, n](m) below.) - _Artur Jasinski_, Oct 16 2008 %C A001008 Better solutions to the card stacking problem have been found by M. Paterson and U. Zwick (see link). - _Hugo Pfoertner_, Jan 01 2012 %C A001008 a(n) = A213999(n, n-1). - _Reinhard Zumkeller_, Jul 03 2012 %C A001008 a(n) coincides with A175441(n) if and only if n is not from the sequence A256102. The quotient a(n) / A175441(n) for n in A256102 is given as corresponding entry of A256103. - _Wolfdieter Lang_, Apr 23 2015 %C A001008 For a very short proof that the Harmonic series diverges, see the Goldmakher link. - _N. J. A. Sloane_, Nov 09 2015 %C A001008 All terms are odd while corresponding denominators (A002805) are all even for n > 1 (proof in Pólya and Szegő). - _Bernard Schott_, Dec 24 2021 %D A001008 John H. Conway and Richard K. Guy, The Book of Numbers, New York: Springer-Verlag, 1996. See pp. 258-261. %D A001008 H. W. Gould, Combinatorial Identities, Morgantown Printing and Binding Co., 1972, # 1.45, page 6, #3.122, page 36. %D A001008 R. L. Graham, D. E. Knuth and O. Patashnik, Concrete Mathematics. Addison-Wesley, Reading, MA, 1990, p. 259. %D A001008 G. H. Hardy and E. M. Wright, An Introduction to the Theory of Numbers. 3rd ed., Oxford Univ. Press, 1954, page 347. %D A001008 D. E. Knuth, The Art of Computer Programming. Addison-Wesley, Reading, MA, Vol. 1, p. 615. %D A001008 G. Pólya and G. Szegő, Problems and Theorems in Analysis, volume II, Springer, reprint of the 1976 edition, 1998, problem 251, p. 154. %D A001008 N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence). %D A001008 N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence). %H A001008 Kenny Lau, <a href="/A001008/b001008.txt">Table of n, a(n) for n = 1..2295</a> (first 200 terms provided by T. D. Noe) %H A001008 David H. Bailey, Jonathan M. Borwein, and Roland Girgensohn, <a href="https://projecteuclid.org/journals/experimental-mathematics/volume-3/issue-1/Experimental-evaluation-of-Euler-sums/em/1062621000.full">Experimental evaluation of Euler sums</a>, Exper. Math. 3(1) (1994), 17-30; they evaluate the constants Sum_{k>=1} H_k^m/(k+1)^n. %H A001008 Hongwei Chen, <a href="https://cs.uwaterloo.ca/journals/JIS/VOL9/Chen/chen78.html">Evaluations of Some Variant Euler Sums</a>, Journal of Integer Sequences, Vol. 9 (2006), Article 06.2.3. %H A001008 Hongwei Chen, <a href="https://cs.uwaterloo.ca/journals/JIS/VOL19/Chen/chen21.html">Interesting Series Associated with Central Binomial Coefficients, Catalan Numbers and Harmonic Numbers</a>, J. Int. Seq. 19 (2016), #16.1.5. %H A001008 R. M. Dickau, <a href="https://www.robertdickau.com/BookStacking.html">Harmonic numbers and the book-stacking problem</a>. %H A001008 Leo Goldmakher, <a href="https://web.williams.edu/Mathematics/lg5/harmonic.pdf">A short(er) proof of the divergence of the harmonic series</a>. %H A001008 Antal Iványi, <a href="https://www.emis.de/journals/AUSM/C5-1/math51-5.pdf">Leader election in synchronous networks</a>, Acta Univ. Sapientiae, Mathematica, 5, 2 (2013), 54-82. %H A001008 Fredrik Johansson, <a href="https://www.emis.de/journals/AUSM/C5-1/math51-5.pdf">How (not) to compute harmonic numbers.</a> Feb 21 2009. %H A001008 Masanobu Kaneko, <a href="https://cs.uwaterloo.ca/journals/JIS/VOL3/KANEKO/AT-kaneko.html">The Akiyama-Tanigawa algorithm for Bernoulli numbers</a>, J. Integer Sequences, 3 (2000), #00.2.9. %H A001008 Romeo Mestrovic, <a href="https://arxiv.org/abs/1111.3057">Wolstenholme's theorem: Its Generalizations and Extensions in the last hundred and fifty years (1862-2011)</a>, arXiv preprint arXiv:1111.3057 [math.NT], 2011. %H A001008 Jerry Metzger and Thomas Richards, <a href="https://cs.uwaterloo.ca/journals/JIS/VOL18/Metzger/metz1.html">A Prisoner Problem Variation</a>, Journal of Integer Sequences, Vol. 18 (2015), Article 15.2.7. %H A001008 Hisanori Mishima, <a href="https://www.asahi-net.or.jp/~KC2H-MSM/mathland/matha1/matha126.htm">Factorizations of Wolstenholme numbers, n=1..100</a>, <a href="https://www.asahi-net.or.jp/~KC2H-MSM/mathland/matha1/matha127.htm">n=101..200</a>, <a href="https://www.asahi-net.or.jp/~KC2H-MSM/mathland/matha1/matha128.htm">n=201..300</a>. %H A001008 Mike Paterson et al., <a href="https://www.math.dartmouth.edu/~pw/papers/maxover.pdf">Maximum Overhang</a>. %H A001008 Maxie D. Schmidt, <a href="https://cs.uwaterloo.ca/journals/JIS/VOL13/Schmidt/multifact.html">Generalized j-Factorial Functions, Polynomials, and Applications</a>, J. Int. Seq. 13 (2010), 10.6.7, Section 4.3. %H A001008 Peter Shiu, <a href="https://arxiv.org/abs/1607.02863">The denominators of harmonic numbers</a>, arXiv:1607.02863 [math.NT], 2016. %H A001008 N. J. A. Sloane, <a href="/A001008/a001008.gif">Illustration of initial terms</a>. %H A001008 Jonathan Sondow and Eric W. Weisstein, <a href="https://mathworld.wolfram.com/HarmonicNumber.html">MathWorld: Harmonic Number</a>. %H A001008 Roberto Tauraso, <a href="https://cs.uwaterloo.ca/journals/JIS/VOL19/Tauraso/taur31.html">Some Congruences for Central Binomial Sums Involving Fibonacci and Lucas Numbers</a>, JIS 19 (2016) # 16.5.4. %H A001008 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/BookStackingProblem.html">Book Stacking Problem</a>, <a href="https://mathworld.wolfram.com/WolstenholmesTheorem.html">Wolstenholme's Theorem</a>, <a href="https://mathworld.wolfram.com/HarmonicMean.html">Harmonic Mean</a>, <a href="https://mathworld.wolfram.com/DigammaFunction.html">Digamma Function</a>. %H A001008 Wikipedia, <a href="https://en.wikipedia.org/wiki/Harmonic_number">Harmonic number</a>. %F A001008 H(n) ~ log n + gamma + O(1/n). [See Hardy and Wright, Th. 422.] %F A001008 log n + gamma - 1/n < H(n) < log n + gamma + 1/n [follows easily from Hardy and Wright, Th. 422]. - _David Applegate_ and _N. J. A. Sloane_, Oct 14 2008 %F A001008 G.f. for H(n): log(1-x)/(x-1). - _Benoit Cloitre_, Jun 15 2003 %F A001008 H(n) = sqrt(Sum_{i = 1..n} Sum_{j = 1..n} 1/(i*j)). - _Alexander Adamchuk_, Oct 24 2004 %F A001008 a(n) is the numerator of Gamma/n + Psi(1 + n)/n = Gamma + Psi(n), where Psi is the digamma function. - _Artur Jasinski_, Nov 02 2008 %F A001008 H(n) = 3/2 + 2*Sum_{k = 0..n-3} binomial(k+2, 2)/((n-2-k)*(n-1)*n), n > 1. - _Gary Detlefs_, Aug 02 2011 %F A001008 H(n) = (-1)^(n-1)*(n+1)*n*Sum_{k = 0..n-1} k!*Stirling2(n-1, k) * Stirling1(n+k+1,n+1)/(n+k+1)!. - _Vladimir Kruchinin_, Feb 05 2013 %F A001008 H(n) = n*Sum_{k = 0..n-1} (-1)^k*binomial(n-1,k)/(k+1)^2. (Wenchang Chu) - _Gary Detlefs_, Apr 13 2013 %F A001008 H(n) = (1/2)*Sum_{k = 1..n} (-1)^(k-1)*binomial(n,k)*binomial(n+k, k)/k. (H. W. Gould) - _Gary Detlefs_, Apr 13 2013 %F A001008 E.g.f. for H(n) = a(n)/A002805(n): (gamma + log(x) - Ei(-x)) * exp(x), where gamma is the Euler-Mascheroni constant, and Ei(x) is the exponential integral. - _Vladimir Reshetnikov_, Apr 24 2013 %F A001008 H(n) = residue((psi(-s)+gamma)^2/2, {s, n}) where psi is the digamma function and gamma is the Euler-Mascheroni constant. - _Jean-François Alcover_, Feb 19 2014 %F A001008 H(n) = Sum_{m >= 1} n/(m^2 + n*m) = gamma + digamma(1+n), numerators and denominators. (see Mathworld link on Digamma). - _Richard R. Forberg_, Jan 18 2015 %F A001008 H(n) = (1/2) Sum_{j >= 1} Sum_{k = 1..n} ((1 - 2*k + 2*n)/((-1 + k + j*n)*(k + j*n))) + log(n) + 1/(2*n). - _Dimitri Papadopoulos_, Jan 13 2016 %F A001008 H(n) = (n!)^2*Sum_{k = 1..n} 1/(k*(n-k)!*(n+k)!). - _Vladimir Kruchinin_, Mar 31 2016 %F A001008 a(n) = Stirling1(n+1, 2) / gcd(Stirling1(n+1, 2), n!) = A000254(n) / gcd(A000254(n), n!). - _Max Alekseyev_, Mar 01 2018 %F A001008 From _Peter Bala_, Jan 31 2019: (Start) %F A001008 H(n) = 1 + (1 + 1/2)*(n-1)/(n+1) + (1/2 + 1/3)*(n-1)*(n-2)/((n+1)*(n+2)) + (1/3 + 1/4)*(n-1)*(n-2)*(n-3)/((n+1)*(n+2)*(n+3)) + ... . %F A001008 H(n)/n = 1 + (1/2^2 - 1)*(n-1)/(n+1) + (1/3^2 - 1/2^2)*(n-1)*(n-2)/((n+1)*(n+2)) + (1/4^2 - 1/3^2)*(n-1)*(n-2)*(n-3)/((n+1)*(n+2)*(n+3)) + ... . %F A001008 For odd n >= 3, (1/2)*H((n-1)/2) = (n-1)/(n+1) + (1/2)*(n-1)*(n-3)/((n+1)*(n+3)) + 1/3*(n-1)*(n-3)*(n-5)/((n+1)*(n+3)*(n+5)) + ... . Cf. A195505. See the Bala link in A036970. (End) %F A001008 H(n) = ((n-1)/2) * hypergeom([1,1,2-n], [2,3], 1) + 1. - _Artur Jasinski_, Jan 08 2021 %F A001008 Conjecture: for nonzero m, H(n) = (1/m)*Sum_{k = 1..n} ((-1)^(k+1)/k) * binomial(m*k,k)*binomial(n+(m-1)*k,n-k). The case m = 1 is well-known; the case m = 2 is given above by Detlefs (dated Apr 13 2013). - _Peter Bala_, Mar 04 2022 %F A001008 a(n) = the (reduced) numerator of the continued fraction 1/(1 - 1^2/(3 - 2^2/(5 - 3^2/(7 - ... - (n-1)^2/(2*n-1))))). - _Peter Bala_, Feb 18 2024 %F A001008 H(n) = Sum_{k=1..n} (-1)^(k-1)*binomial(n,k)/k (H. W. Gould). - _Gary Detlefs_, May 28 2024 %e A001008 H(n) = [ 1, 3/2, 11/6, 25/12, 137/60, 49/20, 363/140, 761/280, 7129/2520, ... ]. %e A001008 Coincidences with A175441: the first 19 entries coincide because 20 is the first entry of A256102. Indeed, a(20)/A175441(20) = 55835135 / 11167027 = 5 = A256103(1). - _Wolfdieter Lang_, Apr 23 2015 %p A001008 A001008 := proc(n) %p A001008 add(1/k,k=1..n) ; %p A001008 numer(%) ; %p A001008 end proc: %p A001008 seq( A001008(n),n=1..40) ; # _Zerinvary Lajos_, Mar 28 2007; _R. J. Mathar_, Dec 02 2016 %t A001008 Table[Numerator[HarmonicNumber[n]], {n, 30}] %t A001008 (* Procedure generating A[1,n](m) (see Comments section) *) m =1; aa = {}; Do[k = 0; Do[k = k + m^(r - d)/d, {d, 1, r - 1}]; AppendTo[aa, k], {r, 1, 20}]; aa (* _Artur Jasinski_, Oct 16 2008 *) %t A001008 Numerator[Accumulate[1/Range[25]]] (* _Alonso del Arte_, Nov 21 2018 *) %t A001008 Numerator[Table[((n - 1)/2)*HypergeometricPFQ[{1, 1, 2 - n}, {2, 3}, 1] + 1, {n, 1, 29}]] (* _Artur Jasinski_, Jan 08 2021 *) %o A001008 (PARI) A001008(n) = numerator(sum(i=1,n,1/i)) \\ _Michael B. Porter_, Dec 08 2009 %o A001008 (PARI) H1008=List(1); A001008(n)={for(k=#H1008,n-1,listput(H1008,H1008[k]+1/(k+1))); numerator(H1008[n])} \\ about 100x faster for n=1..1500. - _M. F. Hasler_, Jul 03 2019 %o A001008 (Haskell) %o A001008 import Data.Ratio ((%), numerator) %o A001008 a001008 = numerator . sum . map (1 %) . enumFromTo 1 %o A001008 a001008_list = map numerator $ scanl1 (+) $ map (1 %) [1..] %o A001008 -- _Reinhard Zumkeller_, Jul 03 2012 %o A001008 (Sage) %o A001008 def harmonic(a, b): # See the F. Johansson link. %o A001008 if b - a == 1: %o A001008 return 1, a %o A001008 m = (a+b)//2 %o A001008 p, q = harmonic(a,m) %o A001008 r, s = harmonic(m,b) %o A001008 return p*s+q*r, q*s %o A001008 def A001008(n): H = harmonic(1,n+1); return numerator(H[0]/H[1]) %o A001008 [A001008(n) for n in (1..29)] # _Peter Luschny_, Sep 01 2012 %o A001008 (Magma) [Numerator(HarmonicNumber(n)): n in [1..30]]; // _Bruno Berselli_, Feb 17 2016 %o A001008 (Python) %o A001008 from sympy import Integer %o A001008 [sum(1/Integer(i) for i in range(1, n + 1)).numerator() for n in range(1, 31)] # _Indranil Ghosh_, Mar 23 2017 %o A001008 (GAP) List([1..30],n->NumeratorRat(Sum([1..n],i->1/i))); # _Muniru A Asiru_, Dec 20 2018 %Y A001008 Cf. A002805 (denominators), A007406, A007408, A007410, A075135, A001220, A125854, A121999, A014566, A056903, A067657, A177427, A177690. %Y A001008 Cf. A145609-A145640. - _Artur Jasinski_, Oct 16 2008 %Y A001008 Cf. A003506. - _Paul Curtz_, Nov 30 2013 %Y A001008 The following fractions are all related to each other: Sum 1/n: A001008/A002805, Sum 1/prime(n): A024451/A002110 and A106830/A034386, Sum 1/nonprime(n): A282511/A282512, Sum 1/composite(n): A250133/A296358. %Y A001008 Cf. A195505. %K A001008 nonn,frac,nice,easy %O A001008 1,2 %A A001008 _N. J. A. Sloane_ %E A001008 Edited by _Max Alekseyev_, Oct 21 2011 %E A001008 Changed title, deleting the incorrect name "Wolstenholme numbers" which conflicted with the definition of the latter in both Weisstein's World of Mathematics and in Wikipedia, as well as with OEIS A007406. - _Stanislav Sykora_, Mar 25 2016