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-3 of 3 results.

A166107 A sequence related to the Madhava-Gregory-Leibniz formula for Pi.

Original entry on oeis.org

2, -10, 46, -334, 982, -10942, 140986, -425730, 7201374, -137366646, 410787198, -9473047614, 236302407090, -710245778490, 20563663645710, -638377099140510, 1912749274005030, -67020067316087550, 2477305680740159850
Offset: 0

Views

Author

Johannes W. Meijer, Oct 06 2009, Feb 26 2013, Mar 02 2013

Keywords

Comments

The EG1 matrix is defined in A162005. The first column of this matrix leads to the function PLS(z) = sum(2*eta(2*m-1)*z^(2*m-2), m=1..infinity) = 2*log(2) - Psi(z) - Psi(-z) + Psi(z/2) + Psi(-z/2). The values of this function for z=n+1/2 are related to Pi in a curious way.
Gauss's digamma theorem leads to PLS(z=n+1/2) = (-1)^n*4*sum((-1)^(k+1)/(2*k-1), k=1..n) + 2/(2*n+1). Now we define PLS(z=n+1/2) = a(n)/p(n) with a(n) the sequence given above and for p(n) we choose the esthetically nice p(n) = (2*n-1)!!/(floor((n-2)/3)*2+1)!!, n=>0. For even values of n the limit(a(2*n)/p(2*n), n=infinity) = Pi and for odd values of n the limit(a(2*n+1)/p(2*n+1), n=infinity) = - Pi. We observe that the a(n)/p(n) formulas resemble the partial sums of the Madhava-Gregory-Leibniz series for Pi = 4*(1-1/3+1/5-1/7+ ...), see the examples. The 'extra term' that appears in the a(n)/p(n) formulas, i.e., 2/(2*n+1), speeds up the convergence of abs(a(n)/p(n)) significantly. The first appearance of a digit in the decimal expansion of Pi occurs here for n: 1, 3, 9, 30, 74, 261, 876, 3056, .., cf. A126809. [Comment modified by the author, Oct 09 2009]

Examples

			The first few values of a(n)/p(n) are: a(0)/p(0) = 2/1; a(1)/p(1) = - 4*(1) + 2/3 = -10/3; a(2)/p(2) = 4*(1-1/3) + 2/5 = 46/15; a(3)/p(3) = - 4*(1-1/3+1/5) + 2/7 = - 334/105; a(4)/p(4)= 4*(1-1/3+1/5-1/7) + 2/9 = 982/315; a(5)/p(5) = - 4*(1-1/3+1/5-1/7+1/9) + 2/11 = -10942/3465; a(6)/p(6) = 4*(1-1/3+1/5-1/7+1/9-1/11) + 2/13 = 140986/45045; a(7)/p(7) = - 4*(1-1/3+1/5-1/7+1/9-1/11+1/13) + 2/15 = - 425730/135135.
		

Crossrefs

Programs

  • Maple
    A166107 := n -> A220747 (n)*((-1)^n*4*sum((-1)^(k+1)/(2*k-1), k=1..n) + 2/(2*n+1)): A130823 := n -> floor((n-1)/3)*2+1: A220747 := n -> doublefactorial(2*n+1) / doublefactorial(A130823(n)): seq(A166107(n), n=0..20);

Formula

a(n) = p(n)*(-1)^n*4*sum((-1)^(k+1)/(2*k-1), k=1..n) + 2/(2*n+1) with
p(n) = doublefactorial(2*n+1)/doublefactorial(floor((n-1)/3)*2+1) = A220747(n)
PLS(z) = 2*log(2) - Psi(z) - Psi(-z) + Psi(z/2) + Psi(-z/2)
PLS(z=n+1/2) = a(n)/p(n) = (-1)^n*4*sum((-1)^(k+1)/(2*k-1), k=1..n) + 2/(2*n+1)
PLS(z=2*n+5/2) - PLS(z=2*n+1/2) = 2/(4*n+5) - 4/(4*n+3) + 2/(4*n+1) which leads to:
Pi = 2 + 16 * sum(1/((4*n+5)*(4*n+3)*(4*n+1)), n=0 .. infinity).
PLS (z=2*n +7/2) - PLS(z=2*n+3/2) = 2/(4*n+7) - 4/(4*n+5) + 2/(4*n+3) which leads to:
Pi = 10/3 - 16*sum(1/((4*n+7)*(4*n+5)*(4*n+3)), n=0 .. infinity).
The combination of these two formulas leads to:
Pi = 8/3 + 48* sum(1/((4*n+7)*(4*n+5)*(4*n+3)*(4*n+1)), n=0 .. infinity).

A274982 a(n) is the number of terms required in the Basel Problem, i.e., Sum_{m >= 1} 1/m^2, for the first appearance of n correct digits in the decimal expansion of Pi^2/6 to occur.

Original entry on oeis.org

1, 22, 203, 1071, 29354, 245891, 14959260, 14959260, 146023209, 1178930480, 20735515065, 121559317130, 4416249685106, 37826529360487, 155364605873808, 2291095531474075, 27417981382118579, 154501831890087986, 2116782166626093033, 13809261875873749757
Offset: 1

Views

Author

G. L. Honaker, Jr., Sep 23 2016

Keywords

Comments

a(n) = round(1/(floor((1/6)Pi^2 * 10^(n-1))/10^(n-1))) for all n up to at least n=1000 (and it can be shown that this formula almost certainly holds for all n beyond that; see A126809 for a similar problem). - Jon E. Schoenfield, Nov 06 2016, Nov 12 2016

Examples

			a(2) = 22 because 22 terms (Sum_{m = 1..22} 1/m^2) are required for the first two decimal digits of Pi^2/6 to occur for the first time.
		

Crossrefs

Programs

  • Perl
    use ntheory ":all"; use bignum try=>"GMP"; my ($dig,$sum,$exp) = (0, 0, (Pi(40)**2)/6); $exp =~ s/\.//; for my $m (1 .. 1e9) { $sum += 1/($m*$m); (my $str = $sum) =~ s/\.//; print ++$dig, " $m\n" while length($str) > $dig && index($exp, substr($str,0,$dig+1)) == 0; } # Dana Jacobsen, Sep 29 2016

Extensions

a(7)-a(11) from Dana Jacobsen, Oct 03 2016

A342584 Minimum k such that all partial sums of the Leibniz series 4/1 - 4/3 + 4/5 - ... with k or more terms give a value of Pi correct to n decimal digits.

Original entry on oeis.org

7, 25, 627, 2454, 136120, 376847, 2886750, 21546984, 278567575, 2437795018, 97974268952, 4836489478578, 4836489478578, 147895359776636, 308788493220129, 4193528956200935, 25999253094360135, 650467164953053602, 2161492060929047665, 26769019461318409710
Offset: 1

Views

Author

Ben Whitmore, Mar 16 2021

Keywords

Comments

Let s(k) be the sum of the first k terms of the Leibniz series, and let eps(k) = |Pi-floor(Pi*10^(k-1))/10^(k-1)|. Then a(n) is either the minimum k such that |Pi-s(k)| < Min(eps(n), 1/10^(n-1)-eps(n)), or one less than the minimum such k.
a(n) is the minimum k such that the k-th and k+1-th partial sums agree with Pi in the first n decimal digits.
It is easy to calculate a(n) for large n because the partial sums of the Leibniz series can be expressed in terms of the digamma function, which can be computed efficiently using an asymptotic series.

Examples

			a(1) = 7 because the sum of the first 6 terms is approximately 2.9706, while the sum of the first 7 terms is approximately 3.2837, and all partial sums of more than 7 terms also have 3 as the first digit.
a(20) = 26769019461318409710 because the sum of the first 26769019461318409709 terms is approximately 3.1415926535897932385000000000000000000007642, while the sum of the first 26769019461318409710 terms is approximately 3.14159265358979323842528, which agrees with Pi in the first 20 digits, as do all partial sums with more terms.
		

Crossrefs

Programs

  • Mathematica
    a[n_]:=Module[{eps,num,check,pi},
    Block[{$MaxExtraPrecision=Infinity},
      pi[k_]:=If[EvenQ[k],
       Pi+PolyGamma[0,N[1/4,n+30]+k/2]-PolyGamma[0,3/4+k/2],
       pi[k+1]+4/(2k+1)
      ];
      eps=Min[#,10^-(n-1)-#]&[Abs[Pi-Floor[Pi 10^(n-1)]/10^(n-1)]];
      num=2Ceiling[k/2]/.FindRoot[PolyGamma[k/2+3/4]-PolyGamma[k/2+1/4]==eps,
       {k,10^(n-1)},WorkingPrecision->2n+30];
      check[a_]:=RealDigits[pi[a],10,n][[1,-1]]==RealDigits[Pi,10,n][[1,-1]];
      num-3+Position[check/@Range[num-3,num],False][[-1,1]]
    ]
    ];
    a/@Range[20]
Showing 1-3 of 3 results.