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 A058313 #94 Sep 02 2025 22:48:54 %S A058313 1,1,5,7,47,37,319,533,1879,1627,20417,18107,263111,237371,52279, %T A058313 95549,1768477,1632341,33464927,155685007,166770367,156188887, %U A058313 3825136961,3602044091,19081066231,18051406831,57128792093,7751493599,236266661971 %N A058313 Numerator of the n-th alternating harmonic number, Sum_{k=1..n} (-1)^(k+1)/k. %C A058313 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 %C A058313 For the limit n -> infinity of the partial sums of the alternating harmonic series see A002162. - _Wolfdieter Lang_, Sep 08 2015 %C A058313 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 %D A058313 L. B. W. Jolley, Summation of Series, Dover Publications, 1961, page 14, #71. %H A058313 T. D. Noe and Robert Israel, <a href="/A058313/b058313.txt">Table of n, a(n) for n = 1..2000</a> (terms up to a(200) from T. D. Noe) %H A058313 Khristo N. Boyadzhiev, <a href="https://sciendo.com/pdf/10.2478/tmmp-2013-0031">Power series with skew-harmonic numbers, dilogarithms, and double integrals</a>, Tatra Mt. Math. Publ., Vol. 56 (2013), pp. 93-108. %H A058313 Hisanori Mishima, <a href="http://www.asahi-net.or.jp/~KC2H-MSM/mathland/matha1/log2_000.htm">Factorizations of many number sequences</a>. %H A058313 Hisanori Mishima, <a href="http://www.asahi-net.or.jp/~KC2H-MSM/mathland/matha1/log2_100.htm">Factorizations of many number sequences</a>. %H A058313 Michael Penn, <a href="https://www.youtube.com/watch?v=lbk4v8DFR7w">A number theory problem from an unlikely source</a>, YouTube video, 2025. %H A058313 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/HarmonicNumber.html">Harmonic Number</a>. %F A058313 G.f. for a(n)/A058312(n): log(1+x)/(1-x). - _Benoit Cloitre_, Jun 15 2003 %F A058313 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 %F A058313 From _Peter Luschny_, May 03 2016: (Start) %F A058313 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: %F A058313 AH(n) = H(n) - H((n - n mod 2)/2). %F A058313 AH(z) = log(2)+(1/2)*cos(Pi*z)*(Psi(z/2+1/2)-Psi(z/2+1)). %F A058313 AH(z) ~ log(2)+(1/2)*cos(Pi*z)*(-1/z+1/(2*z^2)-1/(4*z^4)+1/(2*z^6)-...). %F A058313 AH(z) ~ log(2)-(1/2)*cos(Pi*z)*Sum_{n>=0} Euler(n,0)/z^(n+1). (End) %F A058313 Sum_{k>=1} (-1)^(k+1)*AH(k)/k = Pi^2/12 + log(2)^2/2 (Boyadzhiev, 2013). - _Amiram Eldar_, Oct 04 2021 %F A058313 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 %F A058313 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 %F A058313 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 %e A058313 1, 1/2, 5/6, 7/12, 47/60, 37/60, 319/420, 533/840, 1879/2520, ... %e A058313 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 %p A058313 A058313 := n->numer(add((-1)^(k+1)/k,k=1..n)); %p A058313 # Alternatively: %p A058313 a := n -> numer(harmonic(n) - harmonic((n-modp(n,2))/2)): %p A058313 seq(a(n), n=1..29); # _Peter Luschny_, May 03 2016 %t A058313 Numerator[Table[Sum[(-1)^(k + 1)/k, {k, n}], {n, 30}]] (* _Harvey P. Dale_, Jul 18 2012 *) %t A058313 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 *) %t A058313 Rest[Numerator[CoefficientList[Series[Log[1 + x]/(1 - x), {x, 0, 33}], x]]] (* _Vincenzo Librandi_, Jul 06 2015 *) %t A058313 Table[Log[2] - (-1)^n LerchPhi[-1, 1, n + 1], {n, 20}] // Numerator (* _Eric W. Weisstein_, Aug 25 2023 *) %o A058313 (PARI) a(n)=(-1)^n*numerator(polcoeff(log(1-x)/(x+1)+O(x^(n+1)), n)) %o A058313 (Haskell) %o A058313 import Data.Ratio((%), numerator) %o A058313 a058313 n = a058313_list !! (n-1) %o A058313 a058313_list = map numerator $ scanl1 (+) $ map (1 %) $ tail a181983_list %o A058313 -- _Reinhard Zumkeller_, Mar 20 2013 %Y A058313 Denominators are A058312. Cf. A025530. %Y A058313 Apart from leading term, same as A075830. %Y A058313 Cf. A001008 (numerator of n-th harmonic number). %Y A058313 Bisections are A049281 and A082687. %Y A058313 Cf. A181983. %K A058313 nonn,frac,nice,easy,changed %O A058313 1,3 %A A058313 _N. J. A. Sloane_, Dec 09 2000