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.

A058312 Denominator of the n-th alternating harmonic number, Sum_{k=1..n} (-1)^(k+1)/k.

Original entry on oeis.org

1, 2, 6, 12, 60, 60, 420, 840, 2520, 2520, 27720, 27720, 360360, 360360, 72072, 144144, 2450448, 2450448, 46558512, 232792560, 232792560, 232792560, 5354228880, 5354228880, 26771144400, 26771144400, 80313433200, 11473347600
Offset: 1

Views

Author

N. J. A. Sloane, Dec 09 2000

Keywords

Comments

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

Examples

			1, 1/2, 5/6, 7/12, 47/60, 37/60, 319/420, 533/840, 1879/2520, ...
		

Crossrefs

Numerators are A058313. Cf. A025530.
Cf. A002805 (denominator of n-th harmonic number).

Programs

  • Haskell
    import Data.Ratio((%), denominator)
    a058312 n = a058312_list !! (n-1)
    a058312_list = map denominator $ scanl1 (+) $
                       map (1 %) $ tail a181983_list
    -- Reinhard Zumkeller, Mar 20 2013
  • Maple
    A058313 := n->denom(add((-1)^(k+1)/k,k=1..n));
    # Alternatively:
    a := n -> denom(harmonic(n) - harmonic((n-modp(n,2))/2)):
    seq(a(n), n=1..28); # Peter Luschny, May 03 2016
  • Mathematica
    a[n_] := Sum[(-1)^(k+1)/k, {k, 1, n}]; Table[a[n] // Denominator, {n, 1, 30}] (* Jean-François Alcover, May 26 2015 *)
    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 *)
    Rest[Denominator[CoefficientList[Series[Log[1 + x]/(1 - x),{x, 0, 33}], x]]] (* Vincenzo Librandi, Jul 06 2015 *)
  • PARI
    a(n)=denominator(polcoeff(-log(1-x)/(x+1)+O(x^(n+1)),n))
    
  • PARI
    a(n)=denominator(sum(k=1,n,(-1)^(k+1)/k)) \\ Jeppe Stig Nielsen, Mar 01 2016
    

Formula

G.f. for A058313(n)/ A058312(n): log(1+x)/(1-x). - Benoit Cloitre, Jun 15 2003
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
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