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.

A261208 Terms of the Leibniz formula (as Euler product) that generate successively better approximations to Pi.

Original entry on oeis.org

1, 3, 4, 5, 8, 47, 49, 95, 247, 251, 253, 742, 4268, 4270, 4288, 11445, 30123, 30701, 30703, 62592, 62690, 62992, 3535871, 3535872, 3664203, 3664204, 3664214, 3664220, 3665670, 3665696, 3665842, 3665854, 3665866, 3708907, 3708909, 3708913, 3708929, 3708931, 3708935, 3708957, 3708983, 3708985, 3709017
Offset: 1

Views

Author

Steven Lubars, Aug 11 2015

Keywords

Examples

			Calculating the first 8 terms: c(1)=3, c(2)=3.75, c(3)=3.28125, c(4)=3.0078125, c(5)=3.2584635416, c(6)=3.462117513020833, c(7)=3.289011637369791, c(8)=3.1519694858127165.
In the above sequence, terms 1, 3, 4, 5, and 8 provide successively closer approximations of Pi (whereas approximations 2, 6, and 7 do not).
		

Crossrefs

Programs

  • MUMPS
    s Pi=3.141592653589793238,a=3,n=1,d=Pi-a
    w !,1
    f i=6:6:1e10 d
      s L=i+1**.5\1
      f j=i-1:2:i+1 d
        f k=3:2:L q:'(j#k)
        i j#k d
          s a=a*j/(j#4+j-2),n=n+1
          i $FN(Pi-a,"-")Steven Lubars, Aug 14 2015
  • PARI
    nearmul(p) = if (p % 4 == 1, p-1, p+1);
    lista(nn) = {print1(lb = 1, ", "); v = 3; ld = abs(Pi-3); for (n=2, nn, np = prime(n+1); v *= np/nearmul(np); if ((nld=abs(Pi-v)) < ld, print1(n, ", "); ld = nld););} \\ Michel Marcus, Aug 14 2015
    

Formula

Pi = 4*b(1)*b(2)*b(3)*... where b(n) is the n-th odd prime (A065091) divided by its nearest multiple of 4.
Let c(n) be the n-th term of the expansion such that c(n) = 4*b(1)*...*b(n). The sequence consists of the values n such that c(n) provides a closer approximation of Pi than previous approximations c(1)...c(n-1).