login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A058313 Numerator of the n-th alternating harmonic number, Sum_{k=1..n} (-1)^(k+1)/k. 57
1, 1, 5, 7, 47, 37, 319, 533, 1879, 1627, 20417, 18107, 263111, 237371, 52279, 95549, 1768477, 1632341, 33464927, 155685007, 166770367, 156188887, 3825136961, 3602044091, 19081066231, 18051406831, 57128792093, 7751493599, 236266661971 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,3
COMMENTS
A Wolstenholme-like theorem: for prime p > 3, if p = 6k-1, then p divides a(4k-1), otherwise if p = 6k+1, then p divides a(4k). - T. D. Noe, Apr 01 2004
For the limit n -> infinity of the partial sums of the alternating harmonic series see A002162. - Wolfdieter Lang, Sep 08 2015
a(n)/A058312(n) appears in the locker puzzle (see the links in A364317) as the probability of failures with the strategy used for n lockers and opening of up to floor(n/2) lockers. Note the alternative formula given below for a(n)/A058312(n) using only positive fractions. - Wolfdieter Lang, Aug 12 2023
REFERENCES
L. B. W. Jolley, Summation of Series, Dover Publications, 1961, page 14, #71.
LINKS
T. D. Noe and Robert Israel, Table of n, a(n) for n = 1..2000 (terms up to a(200) from T. D. Noe)
Khristo N. Boyadzhiev, Power series with skew-harmonic numbers, dilogarithms, and double integrals, Tatra Mt. Math. Publ., Vol. 56 (2013), pp. 93-108.
Eric Weisstein's World of Mathematics, Harmonic Number.
FORMULA
G.f. for a(n)/A058312(n): log(1+x)/(1-x). - Benoit Cloitre, Jun 15 2003
a(n) = (n*a(n-1) + (-1)^(n+1)*A058312(n-1))/gcd(n*a(n-1) + (-1)^(n+1)*A058312(n-1), n*A058312(n-1)). - Robert Israel, Jul 06 2015
From Peter Luschny, May 03 2016: (Start)
Let H(n) denote the harmonic numbers, AH(n) denote the alternating harmonic numbers, Psi the polygamma function and euler(n,x) the Euler polynomials. Then:
AH(n) = H(n) - H((n - n mod 2)/2).
AH(z) = log(2)+(1/2)*cos(Pi*z)*(Psi(z/2+1/2)-Psi(z/2+1)).
AH(z) ~ log(2)+(1/2)*cos(Pi*z)*(-1/z+1/(2*z^2)-1/(4*z^4)+1/(2*z^6)-...).
AH(z) ~ log(2)-(1/2)*cos(Pi*z)*Sum_{n>=0} Euler(n,0)/z^(n+1). (End)
Sum_{k>=1} (-1)^(k+1)*AH(k)/k = Pi^2/12 + log(2)^2/2 (Boyadzhiev, 2013). - Amiram Eldar, Oct 04 2021
a(n)/A058312(n) = Sum_{j=0..ceiling(n/2) - 1} 1/(n-j), for n >= 1. (Proof by comparing the recurrences for even and odd n.) - Wolfdieter Lang, Aug 12 2023
For n >= 1, log(2) = a(n)/A058312(n) + (-1)^n*n!*Sum_{k >= 1} 1/(k*(k + 1)* ...*(k + n)*2^k). - Peter Bala, Dec 07 2023
a(n) = the (reduced) numerator of the continued fraction 1/(1 + 1^2/(1 + 2^2/(1 + 3^2/(1 + ... + (n-1)^2/(1))))). - Peter Bala, Feb 18 2024
EXAMPLE
1, 1/2, 5/6, 7/12, 47/60, 37/60, 319/420, 533/840, 1879/2520, ...
For n=4: a(n)/A058312(n) = 7/12 because 1/1 - 1/2 + 1/3 - 1/4 = 7/12 = 1/4 + 1/3. - Wolfdieter Lang, Aug 12 2023
MAPLE
A058313 := n->numer(add((-1)^(k+1)/k, k=1..n));
# Alternatively:
a := n -> numer(harmonic(n) - harmonic((n-modp(n, 2))/2)):
seq(a(n), n=1..29); # Peter Luschny, May 03 2016
MATHEMATICA
Numerator[Table[Sum[(-1)^(k + 1)/k, {k, n}], {n, 30}]] (* Harvey P. Dale, Jul 18 2012 *)
a[n_]:= (-1)^n (HarmonicNumber[n/2 - 1/2] - HarmonicNumber[n/2] + (-1)^n Log[4])/2; Table[a[n] // FullSimplify, {n, 29}] // Numerator (* Gerry Martens, Jul 05 2015 *)
Rest[Numerator[CoefficientList[Series[Log[1 + x]/(1 - x), {x, 0, 33}], x]]] (* Vincenzo Librandi, Jul 06 2015 *)
Table[Log[2] - (-1)^n LerchPhi[-1, 1, n + 1], {n, 20}] // Numerator (* Eric W. Weisstein, Aug 25 2023 *)
PROG
(PARI) a(n)=(-1)^n*numerator(polcoeff(log(1-x)/(x+1)+O(x^(n+1)), n))
(Haskell)
import Data.Ratio((%), numerator)
a058313 n = a058313_list !! (n-1)
a058313_list = map numerator $ scanl1 (+) $ map (1 %) $ tail a181983_list
-- Reinhard Zumkeller, Mar 20 2013
CROSSREFS
Denominators are A058312. Cf. A025530.
Apart from leading term, same as A075830.
Cf. A001008 (numerator of n-th harmonic number).
Bisections are A049281 and A082687.
Cf. A181983.
Sequence in context: A174267 A306649 A075830 * A120301 A119787 A025530
KEYWORD
nonn,frac,nice,easy
AUTHOR
N. J. A. Sloane, Dec 09 2000
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified August 14 13:35 EDT 2024. Contains 375165 sequences. (Running on oeis4.)