%I #54 Feb 18 2024 10:33:05
%S 1,2,6,12,60,60,420,840,2520,2520,27720,27720,360360,360360,72072,
%T 144144,2450448,2450448,46558512,232792560,232792560,232792560,
%U 5354228880,5354228880,26771144400,26771144400,80313433200,11473347600
%N Denominator of the n-th alternating harmonic number, Sum_{k=1..n} (-1)^(k+1)/k.
%C a(n) is a divisor of A003418(n). The first time this is a proper divisor, is a(15); see A269626. - _Jeppe Stig Nielsen_, Mar 01 2016
%H T. D. Noe and Robert Israel, <a href="/A058312/b058312.txt">Table of n, a(n) for n = 1..2000</a> (1..200 from T. D. Noe)
%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/HarmonicNumber.html">Harmonic Number</a>
%F G.f. for A058313(n)/ A058312(n): log(1+x)/(1-x). - _Benoit Cloitre_, Jun 15 2003
%F a(n) = n*a(n-1)/gcd(n*a(n-1), n*A058313(n-1)+(-1)^(n-1)*a(n-1)). - _Robert Israel_, Jul 05 2015
%F a(n) = the (reduced) denominator 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 1, 1/2, 5/6, 7/12, 47/60, 37/60, 319/420, 533/840, 1879/2520, ...
%p A058313 := n->denom(add((-1)^(k+1)/k,k=1..n));
%p # Alternatively:
%p a := n -> denom(harmonic(n) - harmonic((n-modp(n,2))/2)):
%p seq(a(n), n=1..28); # _Peter Luschny_, May 03 2016
%t a[n_] := Sum[(-1)^(k+1)/k, {k, 1, n}]; Table[a[n] // Denominator, {n, 1, 30}] (* _Jean-François Alcover_, May 26 2015 *)
%t a[n_]:= (-1)^n(HarmonicNumber[n/2-1/2]-HarmonicNumber[n/2]+(-1)^n Log[4])/2; Table[a[n] // FullSimplify, {n, 1, 29}] // Denominator (* _Gerry Martens_, Jul 05 2015 *)
%t Rest[Denominator[CoefficientList[Series[Log[1 + x]/(1 - x),{x, 0, 33}], x]]] (* _Vincenzo Librandi_, Jul 06 2015 *)
%o (PARI) a(n)=denominator(polcoeff(-log(1-x)/(x+1)+O(x^(n+1)),n))
%o (PARI) a(n)=denominator(sum(k=1,n,(-1)^(k+1)/k)) \\ _Jeppe Stig Nielsen_, Mar 01 2016
%o (Haskell)
%o import Data.Ratio((%), denominator)
%o a058312 n = a058312_list !! (n-1)
%o a058312_list = map denominator $ scanl1 (+) $
%o map (1 %) $ tail a181983_list
%o -- _Reinhard Zumkeller_, Mar 20 2013
%Y Numerators are A058313. Cf. A025530.
%Y Cf. A002805 (denominator of n-th harmonic number).
%Y Cf. A121594, A181983, A003418, A269626.
%K nonn,frac,nice,easy
%O 1,2
%A _N. J. A. Sloane_, Dec 09 2000