login
The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A126809 Minimum number of terms required in the Gregory-Leibniz series, i.e., 4(1 - 1/3 + 1/5 - 1/7 + 1/9 - ...), to obtain a value of Pi correct to n decimal digits. 3
3, 19, 119, 1688, 10794, 136121, 1530012, 18660270, 156001209, 1695509436, 11136696006, 102111268282, 1260654956982, 10725187563686, 147895359776637, 1313133218365935, 16250291773636035, 118166387818704586, 1860961545617561679, 15963377896404315146 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,1

COMMENTS

Calculations by Jud McCranie.

The m-th partial sum of the Gregory-Leibniz series approaches Pi - (-1)^m * (1/m - 1/(4m^3) + 5/(16m^5) - 61/(64m^7) + 1385/(256m^9) - ...), where the numerators 1, 1, 5, 61, 1385, ... are the Euler (or secant or "Zig") numbers, A000364. I.e., 4*Sum_{i=1..m} (-1)^(m+1)/(2m-1) approaches Pi - 2*(-1)^m*Sum_{j=0,1,2,...}(-1)^j*A000364(j)/(2m)^(2j+1)); this latter alternating sum eventually diverges, but for any number of digits n > 1, we can take just its first term (i.e., the j=0 term), Pi - (-1)^m/m, set it equal to the lower or upper limit of the desired interval around Pi (whichever limit is farther from Pi), and round m up as necessary to get either a(n) or (possibly) a number that differs from a(n) by only 2 (see Example section). - Jon E. Schoenfield, Nov 11 2016

LINKS

Jon E. Schoenfield, Table of n, a(n) for n = 1..100

FORMULA

From Jon E. Schoenfield, Nov 11 2016: (Start)

The following has been verified to give the correct value of a(n) for all n from a(2)=19 through at least a(10000) = 11673...08624 (a 10000-digit number), and very likely for all n beyond 10000 as well (since the discarded terms 1/(4m^3), 5/(16m^5), etc. rapidly become small, so the simple approximation S(m) = Pi - (-1)^m/m becomes increasingly accurate):

Let x = Pi * 10^(n-1). If x - floor(x) < 1/2, then a(n) = 1 + 2*floor((1/(ceiling(x)/10^(n-1) - Pi) + 1)/2); otherwise, a(n) = 2*ceiling((1/2)/(Pi - floor(x)/10^(n-1))). (End)

EXAMPLE

E.g., a(2)=19 because if 4 is multiplied by the sum of the first 19 terms of the alternating series, then the result begins with 3.1 (the first two decimal digits of Pi) for the first time.

At n=3, we want the smallest m such that the partial sum S(m) = 4(1 - 1/3 + 1/5 - 1/7 + ... - (-1)^m/(2m-1)) is in the half-open interval [3.14,3.15). S(m) < Pi iff m is even, so for even m, setting Pi - (-1)^m/m = Pi - 1/m equal to 3.14 gives m=627.882..., and rounding up to the next even number gives 628. The other end of the interval, however, being farther from Pi, will be reached at a smaller value of m; for odd m, setting Pi - (-1)^m/m = Pi + 1/m equal to 3.15 gives m=118.943..., and rounding up to the next odd number gives 119. As it turns out, m=117 is the last odd number to fail (giving a sum of 3.150139...); m=119 succeeds (sum=3.149995...). No even number less than 628 yields a sum in the interval, so a(3)=119. - Jon E. Schoenfield, Nov 11 2016

CROSSREFS

Cf. A000364.

For a similar problem involving the convergence of a non-alternating series, see A274982. - Jon E. Schoenfield, Nov 11 2016

Sequence in context: A274852 A139176 A302443 * A340644 A020073 A138977

Adjacent sequences:  A126806 A126807 A126808 * A126810 A126811 A126812

KEYWORD

nonn,base

AUTHOR

G. L. Honaker, Jr., Mar 14 2007

EXTENSIONS

a(6)-a(8) from Mike Keith (domnei(AT)aol.com), Mar 18 2007

Edited by Jon E. Schoenfield, Nov 11 2016

STATUS

approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified February 26 03:00 EST 2021. Contains 341619 sequences. (Running on oeis4.)