%I #4 Sep 27 2014 19:02:15
%S 1,1,1,3,4,5,6,7,8,10,11,12,13,14,15,17,18,19,20,21,22,23,25,26,27,28,
%T 29,30,32,33,34,35,36,37,39,40,41,42,43,44,46,47,48,49,50,51,53,54,55,
%U 56,57,58,59,61,62,63,64,65,66,68,69,70,71,72,73,75,76
%N Least number k such that Pi - v(k) < 1/5^n, where v is defined using the Borchardt-Pfaff algorithm; see Comments.
%C The sequences u and v are defined by joint recurrences: u(n) = 2*u(n-1)*v(n-1)/(u(n-1) + v(n-1)) and v(n) = sqrt(u(n)*v(n-1)), with initial values u(0) = 2*sqrt(3) and v(0) = 3. This Borchardt-Pfaff algorithm is used to approximate Pi; see Finch.
%C Is A247832(n) - A247833(n) in {0,1} for n >= 0?
%D Steven R. Finch, Mathematical Constants, Cambridge University Press, 2003, p. 19.
%H Clark Kimberling, <a href="/A247833/b247833.txt">Table of n, a(n) for n = 0..1000</a>
%e Approximations for the first few terms of u - Pi, Pi - v, and 1/5^n are shown here:
%e n ... u(n) - Pi ... Pi - v(n) ... 1/5^n
%e 0 ... 0.322509 .... 0.1415930 ... 1
%e 1 ... 0.0737977 ... 0.035764 .... 0.2
%e 2 ... 0.0180673 ... 0.008964 .... 0.04
%e 3 ... 0.00449356 .. 0.002242 .... 0.008
%e 4 ... 0.00112195 .. 0.000560 .... 0.0016
%e 5 ... 0.00028039 .. 0.000140 .... 0.00032
%e 6 ... 0.00007009 .. 0.000035 .... 0.000064
%e 7 ... 0.00001752 .. 0.000008 .... 0.0000128
%e a(3) = 3 because v(3) < 1/5^3 < v(2).
%t $RecursionLimit = 1000; z = 200; u[0] = N[2*Sqrt[3], 100]; v[0] = 3;
%t u[n_] := u[n] = 2*u[n - 1]*v[n - 1]/(u[n - 1] + v[n - 1]); v[n_] := v[n] =
%t Sqrt[u[n]*v[n - 1]]; f[n_] := f[n] = Select[Range[z], u[#] - Pi < 5^(-n) &, 1];
%t Flatten[Table[f[n], {n, 0, z}]] (* A247832 *)
%t g[n_] := g[n] = Select[Range[z], Pi - v[#] < 5^(-n) &, 1]
%t Flatten[Table[g[n], {n, 0, z}]] (* A247833 *)
%Y Cf. A247832.
%K nonn,easy
%O 0,4
%A _Clark Kimberling_, Sep 26 2014