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.

Showing 1-6 of 6 results.

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

Original entry on oeis.org

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
Offset: 1

Views

Author

N. J. A. Sloane, Dec 09 2000

Keywords

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

Examples

			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
		

References

  • L. B. W. Jolley, Summation of Series, Dover Publications, 1961, page 14, #71.

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.

Programs

  • 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
  • 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 *)
  • PARI
    a(n)=(-1)^n*numerator(polcoeff(log(1-x)/(x+1)+O(x^(n+1)), n))
    

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

A075829 Let u(1) = x and u(n+1) = (n^2/u(n)) + 1 for n >= 1; then a(n) is such that u(n) = (b(n)*x + c(n))/(d(n)*x + a(n)) (in lowest terms) and a(n), b(n), c(n), d(n) are positive integers.

Original entry on oeis.org

1, 0, 1, 1, 5, 13, 23, 101, 307, 641, 893, 7303, 9613, 97249, 122989, 19793, 48595, 681971, 818107, 13093585, 77107553, 66022193, 76603673, 1529091919, 1752184789, 7690078169, 8719737569, 23184641107, 3721854001, 96460418429
Offset: 1

Views

Author

Benoit Cloitre, Oct 14 2002

Keywords

Comments

For x real <> 1 - 1/log(2), Lim_{n -> infinity} abs(u(n) - n) = abs((x - 1)/(1 + (x - 1)*log(2))). [Corrected by Petros Hadjicostas, May 18 2020]
Difference between the denominator and the numerator of the (n-1)-th alternating harmonic number Sum_{k=1..n-1} (-1)^(k+1)*1/k = A058313(n-1)/A058312(n-1). - Alexander Adamchuk, Jul 22 2006
From Petros Hadjicostas, May 06 2020: (Start)
Inspired by Michael Somos's result below, we established the following formulas (valid for n >= 2). All the denominators in the first three formulas are equal to A334958(n).
b(n) = A024167(n)/gcd(A024167(n-1), A024167(n)).
c(n) = A024168(n)/gcd(A024168(n-1), A024168(n)).
d(n) = A024167(n-1)/gcd(A024167(n-1), A024167(n)).
b(n) + c(n) = n*(d(n) + a(n)).
u(n) = (A024167(n)*x + A024168(n))/(A024167(n-1)*x + A024168(n-1)). (End)

Crossrefs

Cf. A075827 (= b), A075828 (= c), A075830 (= d).

Programs

  • Mathematica
    Denominator[Table[Sum[(-1)^(k+1)*1/k,{k,1,n-1}],{n,1,30}]]-Numerator[Table[Sum[(-1)^(k+1)*1/k,{k,1,n-1}],{n,1,30}]] (* Alexander Adamchuk, Jul 22 2006 *)
  • PARI
    u(n) = if(n<2, x, (n-1)^2/u(n-1)+1);
    a(n) = polcoeff(denominator(u(n)), 0, x);

Formula

a(n) = A024168(n-1)/gcd(A024168(n-1), A024168(n)). - Michael Somos, Oct 29 2002
From Alexander Adamchuk, Jul 22 2006: (Start)
a(n) = A058312(n-1) - A058313(n-1) for n > 1 with a(1) = 1.
a(n) = denominator(Sum_{k=1..n-1} (-1)^(k+1)*1/k) - numerator(Sum_{k=1..n-1}(-1)^(k+1)*1/k). (End)

Extensions

Name edited by Petros Hadjicostas, May 06 2020

A334958 GCD of consecutive terms of the factorial times the alternating harmonic series.

Original entry on oeis.org

1, 1, 1, 2, 2, 12, 12, 48, 144, 1440, 1440, 17280, 17280, 241920, 18144000, 145152000, 145152000, 2612736000, 2612736000, 10450944000, 219469824000, 4828336128000, 4828336128000, 115880067072000, 579400335360000, 15064408719360000, 135579678474240000, 26573616980951040000, 26573616980951040000
Offset: 1

Views

Author

Petros Hadjicostas, May 17 2020

Keywords

Comments

For n = 1..14, we have a(n) = A025527(n), but a(15) = 18144000 <> 3628800 = A025527(15).
It appears that A025527(n) | a(n) for all n >= 1 and A025527(n) = a(n) for infinitely many n. In addition, it seems that a(n)/a(n-1) = A048671(n) for infinitely many n >= 2. However, I have not established these claims.
This sequence appears in formulas for sequences A075827, A075828, A075829, and A075830 (the first one of which was established in 2002 by Michael Somos).
Conjecture: a(n) = n! * Product_{p <= n} p^min(0, v_p(H'(n))), where the product ranges over primes p, H'(n) = Sum_{k=1..n} (-1)^(k+1)/k, and v_p(r) is the p-adic valuation of rational r (checked for n < 1100).

Examples

			A024167(4) = 4!*(1 - 1/2 + 1/3 - 1/4) = 14, A024167(5) = 5!*(1 - 1/2 + 1/3 - 1/4 + 1/5) = 94, A024168(4) = 4!*(1/2 - 1/3 + 1/4) = 10, and A024168(5) = 5!*(1/2 - 1/3 + 1/4 - 1/5) = 26. Then a(4) = gcd(14, 94) = gcd(10, 26) = gcd(14, 4!) = gcd(10, 4!) = gcd(14, 10) = 2.
		

Crossrefs

Cf. A056612 (similar sequence for the harmonic series).

Programs

  • Maple
    b:= proc(n) b(n):= (-(-1)^n/n +`if`(n=1, 0, b(n-1))) end:
    a:= n-> (f-> igcd(b(n)*f, f))(n!):
    seq(a(n), n=1..30);  # Alois P. Heinz, May 18 2020
  • Mathematica
    b[n_] := b[n] = -(-1)^n/n + If[n == 1, 0, b[n-1]];
    a[n_] := GCD[b[n] #, #]&[n!];
    Array[a, 30] (* Jean-François Alcover, Oct 27 2020, after Alois P. Heinz *)
  • SageMath
    def A():
        a, b, n = 1, 1, 2
        while True:
            yield gcd(a, b)
            b, a = a, a + b * n * n
            n += 1
    a = A(); print([next(a) for  in range(29)]) # _Peter Luschny, May 19 2020

Formula

a(n) = gcd(A024167(n+1), A024167(n)) = gcd(A024168(n+1), A024168(n)) = gcd(A024167(n), n!) = gcd(A024168(n), n!) = gcd(A024167(n), A024168(n)).

A075827 Let u(1) = x and u(n+1) = (n^2/u(n)) + 1 for n >= 1; then a(n) is such that u(n) =(a(n)*x + b(n))/(c(n)*x + d(n)) (in lowest terms) and a(n), b(n), c(n), d(n) are positive integers.

Original entry on oeis.org

1, 1, 5, 14, 47, 222, 319, 2132, 5637, 16270, 20417, 217284, 263111, 3323194, 3920925, 764392, 1768477, 29382138, 33464927, 622740028, 3502177707, 3436155514, 3825136961, 86449058184, 95405331155, 469336577606, 514159128837, 1519292745404, 236266661971, 6755272778730, 7313175618421
Offset: 1

Views

Author

Benoit Cloitre, Oct 14 2002

Keywords

Comments

For x real <> 1 - 1/log(2), Lim_{n -> infinity} abs(u(n) - n) = abs((x - 1)/(1 + (x - 1)*log(2))). [Corrected by Petros Hadjicostas, May 18 2020]

Crossrefs

Cf. A075828 (= b), A075829 (= d), A075830 (= c).

Programs

  • PARI
    u(n) = if(n<2, x, (n-1)^2/u(n-1)+1);
    a(n) = polcoeff(numerator(u(n)), 1, x);
    for(n=1, 30, print1(a(n)", ")) \\ Petros Hadjicostas, May 06 2020

Formula

From Petros Hadjicostas, May 18 2020: (Start)
a(n) = A024167(n)/gcd(A024167(n), A024167(n-1)) = A024167(n)/A334958(n-1) for n >= 2. (Cf. Michael Somos's result for d = A075829 using A024168.)
u(n) = (A024167(n)*x + A024168(n))/(A024167(n-1)*x + A024168(n-1)) for n >= 2. (End)

Extensions

Name edited by Petros Hadjicostas, May 06 2020
More terms from Michel Marcus, Aug 01 2025

A075828 Let u(1) = x and u(n+1) = (n^2/u(n)) + 1 for n >= 1; then a(n) is such that u(n) =(b(n)*x + a(n))/(c(n)*x + d(n)) (in lowest terms) and a(n), b(n), c(n), d(n) are positive integers.

Original entry on oeis.org

0, 1, 1, 10, 13, 138, 101, 1228, 1923, 8930, 7303, 115356, 97249, 1721846, 1484475, 388760, 681971, 14725926, 13093585, 308430212, 1386466053, 1685280806, 1529091919, 42052434936, 38450390845, 226713176794, 208661769963
Offset: 1

Views

Author

Benoit Cloitre, Oct 14 2002

Keywords

Comments

For x real <> 1 - 1/log(2), Lim_{n -> infinity} abs(u(n) - n) = abs((x - 1)/(1 + (x - 1)*log(2))). [Corrected by Petros Hadjicostas, May 18 2020]

Crossrefs

Cf. A075827 (= b), A075829 (= d), A075830 (= c).

Programs

  • PARI
    u(n) = if(n<2, x, (n-1)^2/u(n-1)+1);
    a(n) = polcoeff(numerator(u(n)), 0 ,x)

Formula

From Petros Hadjicostas, May 18 2020: (Start)
a(n) = A024168(n)/gcd(A024168(n), A024168(n-1)) = A024168(n)/A334958(n) for n >= 2. (Cf. Michael Somos's claim for d = A075829 using A024168.)
u(n) = (A024167(n)*x + A024168(n))/(A024167(n-1)*x + A024168(n-1)) for n >= 2. (End)

Extensions

Name edited by Petros Hadjicostas, May 06 2020

A173756 Partial sums of A058313.

Original entry on oeis.org

1, 2, 7, 14, 61, 98, 417, 950, 2829, 4456, 24873, 42980, 306091, 543462, 595741, 691290, 2459767, 4092108, 37557035, 193242042, 360012409, 516201296, 4341338257, 7943382348, 27024448579, 45075855410, 102204647503, 109956141102, 346222803073, 571398562364
Offset: 1

Views

Author

Jonathan Vos Post, Feb 23 2010

Keywords

Comments

Partial sum of the numerator of the n-th alternating harmonic number.

Crossrefs

Cf. A001008 (numerator of the n-th harmonic number), A025530, A058312 (denominators of the underlying sequence), A058313, A075830.

Programs

  • Maple
    a := proc(n) local i, k:
    add(numer(add((-1)^(k + 1)/k, k = 1 .. i)), i = 1 .. n): end proc:
    seq(a(n), n = 1 .. 40); # Petros Hadjicostas, May 06 2020
  • PARI
    a(n) = sum(i=1, n, numerator(sum(k=1, i, (-1)^(k+1)/k))); \\ Michel Marcus, May 07 2020

Formula

a(n) = Sum_{i=1..n} A058313(i) = Sum_{i=1..n} numerator(Sum_{k=1..i} (-1)^(k+1)/k). [Corrected by Petros Hadjicostas and Michel Marcus, May 06 2020]

Extensions

Data corrected and extended by Petros Hadjicostas, May 06 2020
Showing 1-6 of 6 results.