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.

A002805 Denominators of harmonic numbers H(n) = Sum_{i=1..n} 1/i.

This page as a plain text file.
%I A002805 M1589 N0619 #174 Mar 22 2025 13:33:36
%S A002805 1,2,6,12,60,20,140,280,2520,2520,27720,27720,360360,360360,360360,
%T A002805 720720,12252240,4084080,77597520,15519504,5173168,5173168,118982864,
%U A002805 356948592,8923714800,8923714800,80313433200,80313433200,2329089562800,2329089562800,72201776446800
%N A002805 Denominators of harmonic numbers H(n) = Sum_{i=1..n} 1/i.
%C A002805 H(n)/2 is the maximal distance that a stack of n cards can project beyond the edge of a table without toppling.
%C A002805 If n is not in {1, 2, 6} then a(n) has at least one prime factor other than 2 or 5. E.g., a(5) = 60 has a prime factor 3 and a(7) = 140 has a prime factor 7. This implies that every H(n) = A001008(n)/A002805(n), n not from {1, 2, 6}, has an infinite decimal representation. For a proof see the J. Havil reference. - _Wolfdieter Lang_, Jun 29 2007
%C A002805 a(n) = A213999(n,n-1). - _Reinhard Zumkeller_, Jul 03 2012
%C A002805 From _Wolfdieter Lang_, Apr 16 2015: (Start)
%C A002805 a(n)/A001008(n) = 1/H(n) is the solution of the following version of the classical cistern and pipes problem. A cistern is connected to n different pipes of water. For the k-th pipe it takes k time units (say, days) to fill the empty cistern, for k = 1, 2, ..., n. How long does it take for the n pipes together to fill the empty cistern? 1/H(n) gives the answer as a fraction of the time unit.
%C A002805 In general, if the k-th pipe needs d(k) days to fill the empty cistern then all pipes together need 1/Sum_{k=1..n} 1/d(k) = HM(d(1), ..., d(n))/n days, where HM denotes the harmonic mean HM. For the described problem, HM(1, 2, ..., n)/n = A102928(n)/(n*A175441(n)) = 1/H(n).
%C A002805 For a classical cistern and pipes problem see, e.g., the Hunger-Vogel reference (in Greek and German) given in A256101, problem 27, p. 29, where n = 3, and d(1), d(2) and d(3) are 6, 4 and 3 days. On p. 97 of this reference one finds remarks on the history of such problems (called in German 'Brunnenaufgabe'). (End)
%C A002805 From _Wolfdieter Lang_, Apr 17 2015: (Start)
%C A002805 An example of the above mentioned cistern and pipes problems appears in Chiu Chang Suan Shu (nine books on arithmetic) in book VI, problem 26. The numbers are there 1/2, 1, 5/2, 3 and 5 (days) and the result is 15/75 (day). See the reference (in German) on p. 68.
%C A002805 A historical account on such cistern problems is found in the Johannes Tropfke reference, given in A256101, section 4.2.1.2 Zisternenprobleme (Leistungsprobleme), pp. 578-579.
%C A002805 In Fibonacci's Liber Abaci such problems appear on p. 281 and p. 284 of L. E. Sigler's translation. (End)
%C A002805 All terms > 1 are even while corresponding numerators (A001008) are all odd (proof in Pólya and Szegő). - _Bernard Schott_, Dec 24 2021
%D A002805 Chiu Chang Suan Shu, Neun Bücher arithmetischer Technik, translated and commented by Kurt Vogel, Ostwalds Klassiker der exakten Wissenschaften, Band 4, Friedr. Vieweg & Sohn, Braunschweig, 1968, p. 68.
%D A002805 John H. Conway and Richard K. Guy, The Book of Numbers, New York: Springer-Verlag, 1996. See pp. 258-261.
%D A002805 R. L. Graham, D. E. Knuth and O. Patashnik, Concrete Mathematics. Addison-Wesley, Reading, MA, 1990, p. 259.
%D A002805 J. Havil, Gamma, (in German), Springer, 2007, p. 35-6; Gamma: Exploring Euler's Constant, Princeton Univ. Press, 2003.
%D A002805 D. E. Knuth, The Art of Computer Programming. Addison-Wesley, Reading, MA, Vol. 1, p. 615.
%D A002805 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 A002805 L. E. Sigler, Fibonacci's Liber Abaci, Springer, 2003, pp. 281, 284.
%D A002805 N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
%D A002805 N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
%H A002805 Kenny Lau, <a href="/A002805/b002805.txt">Table of n, a(n) for n = 1..2308</a> [First 200 terms computed by T. D. Noe]
%H A002805 R. M. Dickau, <a href="http://mathforum.org/advanced/robertd/harmonic.html">Harmonic numbers and the book stacking problem</a>.
%H A002805 Haight, Frank A., and Robert B. Jones., <a href="/A025529/a025529.pdf">"A probabilistic treatment of qualitative data with special reference to word association tests."</a> Journal of Mathematical Psychology 11.3 (1974): 237-244. [Annotated scanned copy]
%H A002805 Frank Haight and N. J. A. Sloane, <a href="/A002805/a002805.pdf">Correspondence, 1975</a>.
%H A002805 Antal Iványi, <a href="http://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 A002805 Fredrik Johansson, <a href="http://fredrik-j.blogspot.de/2009/02/how-not-to-compute-harmonic-numbers.html">How (not) to compute harmonic numbers</a>, Feb 21 2009.
%H A002805 Peter Shiu, <a href="http://arxiv.org/abs/1607.02863">The denominators of harmonic numbers</a>, arXiv:1607.02863 [math.NT], 2016.
%H A002805 N. J. A. Sloane, <a href="/A001008/a001008.gif">Illustration of initial terms</a>.
%H A002805 Jonathan Sondow and Eric W. Weisstein, <a href="https://mathworld.wolfram.com/HarmonicNumber.html">MathWorld: Harmonic Number</a>.
%H A002805 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/BookStackingProblem.html">Book Stacking Problem</a>.
%H A002805 Bing-Ling Wu, Yong-Gao Chen, <a href="https://arxiv.org/abs/1711.00184">On the denominators of harmonic numbers</a>, arXiv:1711.00184 [math.NT], 2017.
%F A002805 a(n) = Denominator(Sum_{k=1..n} (2*k-1)/k). - _Gary Detlefs_, Jul 18 2011
%F A002805 a(n) = n! / gcd(Stirling1(n+1, 2), n!) = n! / gcd(A000254(n),n!). - _Max Alekseyev_, Mar 01 2018
%F A002805 a(n) = the (reduced) denominator 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
%e A002805 H(n) = [ 1, 3/2, 11/6, 25/12, 137/60, 49/20, 363/140, 761/280, 7129/2520, ... ] = A001008/A002805.
%p A002805 seq(denom(sum((2*k-1)/k, k=1..n), n=1..30); # _Gary Detlefs_, Jul 18 2011
%p A002805 f:=n->denom(add(1/k, k=1..n)); # _N. J. A. Sloane_, Nov 15 2013
%t A002805 Denominator[ Drop[ FoldList[ #1 + 1/#2 &, 0, Range[ 30 ] ], 1 ] ] (* _Harvey P. Dale_, Feb 09 2000 *)
%t A002805 Table[Denominator[HarmonicNumber[n]], {n, 1, 40}] (* _Stefan Steinerberger_, Apr 20 2006 *)
%t A002805 Denominator[Accumulate[1/Range[25]]] (* _Alonso del Arte_, Nov 21 2018 *)
%o A002805 (PARI) a(n)=denominator(sum(k=2,n,1/k)) \\ _Charles R Greathouse IV_, Feb 11 2011
%o A002805 (Haskell)
%o A002805 import Data.Ratio ((%), denominator)
%o A002805 a002805 = denominator . sum . map (1 %) . enumFromTo 1
%o A002805 a002805_list = map denominator $ scanl1 (+) $ map (1 %) [1..]
%o A002805 -- _Reinhard Zumkeller_, Jul 03 2012
%o A002805 (Sage)
%o A002805 def harmonic(a, b): # See the F. Johansson link.
%o A002805     if b - a == 1 : return 1, a
%o A002805     m = (a+b)//2
%o A002805     p, q = harmonic(a,m)
%o A002805     r, s = harmonic(m,b)
%o A002805     return p*s+q*r, q*s
%o A002805 def A002805(n) : H = harmonic(1,n+1); return denominator(H[0]/H[1])
%o A002805 [A002805(n) for n in (1..29)] # _Peter Luschny_, Sep 01 2012
%o A002805 (Magma) [Denominator(HarmonicNumber(n)): n in [1..40]]; // _Vincenzo Librandi_, Apr 16 2015
%o A002805 (GAP) List([1..30],n->DenominatorRat(Sum([1..n],i->1/i))); # _Muniru A Asiru_, Dec 20 2018
%o A002805 (Python)
%o A002805 from fractions import Fraction
%o A002805 def a(n): return sum(Fraction(1, i) for i in range(1, n+1)).denominator
%o A002805 print([a(n) for n in range(1, 30)]) # _Michael S. Branicky_, Dec 24 2021
%Y A002805 Cf. A001008 (numerators), A075135, A025529, A203810, A203811, A203812.
%Y A002805 Partial sums: A027612/A027611 = 1, 5/2, 13/3, 77/12, 87/10, 223/20,...
%Y A002805 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, Sum 1/n^2: A007406/A007407, Sum 1/n^3: A007408/A007409.
%K A002805 nonn,easy,frac,nice
%O A002805 1,2
%A A002805 _N. J. A. Sloane_
%E A002805 Definition edited by _Daniel Forgues_, May 19 2010