A093418 Numerator of -3*n + 2*(1+n)*HarmonicNumber(n).
0, 1, 3, 17, 53, 62, 163, 717, 3489, 3727, 43391, 45596, 619313, 644063, 667229, 2756003, 24124223, 24784883, 160941559, 164719333, 33664415, 11451017, 268428987, 819836496, 20845424563, 21181779967, 193553388003, 196368607553, 5773568883787, 5849866645327
Offset: 0
Examples
fr(n) = 0, 1, 3, 17/3, 53/6, 62/5, 163/10, 717/35, 3489/140, ... = A093418/A096620.
References
- Peter J. Cameron, Combinatorics: Topics, Techniques and Algorithms, Cambridge Univ. Press, 1996; see pp. 66-68.
- J. H. Conway and R. K. Guy, The Book of Numbers. New York: Springer-Verlag, 1996, pp. 143 and 258-259.
- Julian Havil, Gamma: Exploring Euler's constant, Princeton University Press, 2003; see pp. 128-130.
- D. E. Knuth, The Art of Computer Programming. Addison-Wesley, Reading, MA, Vol. 3, 1998; see pp. 427-431 and 454-455.
Links
- G. C. Greubel, Table of n, a(n) for n = 0..1000 [recomputed for offset 0 by _Georg Fischer_, Oct 13 2019]
- S. B. Ekhad and D. Zeilberger, A detailed analysis of quicksort running time, arXiv:1903.03708 [math.PR], 2019. [They have the recurrence with n-1, rather than n, from which they get -4*n + 2*(1+n)*HarmonicNumber(n) for the average number of comparisons.]
- M. Kauers and P. Paule, The Concrete Tetrahedron, Springer, 2011; see p. 4. [They agree with Cameron's recurrence and the numerators are in A115107.]
- Eric Weisstein's World of Mathematics, Quicksort. [He uses Havil's recurrence.]
- Eric Weisstein's World of Mathematics, Harmonic Number.
- Wikipedia, Quicksort. [Uses Cameron's recurrence and the numerators are in A115107.]
Crossrefs
Programs
-
Magma
[Numerator(2*(n+1)*HarmonicNumber(n) -3*n): n in [0..50]]; // G. C. Greubel, Sep 01 2018
-
Maple
a := n -> numer(2*(n + 1)*(Psi(n + 1) + gamma) - 3*n); seq(a(n), n=0..26); # Peter Luschny, Aug 26 2019
-
Mathematica
Numerator[Table[2*Sum[Sum[1/i, {i, 1, k}], {k, 1, n}]-n, {n, 0, 20}]] (* or *) Numerator[Table[2*Sum[HarmonicNumber[k], {k, 1, n}]-n, {n, 0, 20}]] Numerator[Table[2*(n+1)*HarmonicNumber[n] - 3*n, {n, 0, 50}]] (* G. C. Greubel, Sep 01 2018 *)
-
PARI
{h(n) = sum(k=1,n,1/k)}; for(n=0,50, print1(numerator(2*(n+1)*h(n) -3*n), ", ")) \\ G. C. Greubel, Sep 01 2018
-
Python
from fractions import Fraction from itertools import count, islice def agen(): # generator of terms Hn = Fraction(0, 1) for n in count(0): yield (-3*n + 2*(1+n)*Hn).numerator Hn += Fraction(1, n+1) print(list(islice(agen(), 27))) # Michael S. Branicky, Apr 17 2022
Formula
G.f. for fractions fr(n): -(x+2*log(1-x))/(1-x)^2. - Vladeta Jovovic, Jul 05 2004
a(n) = 1 + (1/n!) * Sum_{k=0..n} (-1)^(n-k) * Stirling1(n, k) * (k-1) * 2^k. - Vladeta Jovovic, Jul 05 2004
a(n) = numerator(-n + 2 * H^{2}(n)), where H^{2}(n) = Sum_{k=1..n} HarmonicNumber(k) is second-order harmonic number. - Alexander Adamchuk, Nov 01 2004
Extensions
Edited by Eric W. Weisstein, Jul 01 2004
Offset changed to 0 by Petros Hadjicostas, Aug 26 2019
Comments