Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2005
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2005

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: extracting decimal digits of Pi

  • To: mathgroup at smc.vnet.net
  • Subject: [mg55860] Re: [mg55841] extracting decimal digits of Pi
  • From: János <janos.lobb at yale.edu>
  • Date: Fri, 8 Apr 2005 01:36:33 -0400 (EDT)
  • References: <200504070911.FAA12986@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

Based upon Wolfram's NKS book;

http://www.wolframscience.com/nksonline/page-911f-text

In[14]:=
dat[n_Integer] :=
   (#1[[2]]^2/#1[[3]] & )[
    NestWhile[
     Function[{a, b, c, d},
        {(a + b)/2, Sqrt[a*b],
         c - d*(a - b)^2,
         2*d}] @@ #1 & ,
     {1, 1/Sqrt[N[2, n]], 1/4,
      1/4}, #1[[1]] !=
       #1[[2]] & ]]

In[19]:=
bb100000 = bb[100000];

In[20]:=
First[RealDigits[bb100000,
    10, 100000, -1]]

sinks the available memory in top with only about 6M.

János
On Apr 7, 2005, at 5:11 AM, zak wrote:

> hi
> in my previous letter i mentioned extracting the first 100000 decimal
> digits of Pi, and to put it in a List.
> the following code is my version,:
> dat = IntegerDigits[ToExpression[StringDrop[ToString[N[Pi,  
> 500000]], 2]]];
>
> i think it is consuming the memory of the computer.
> i hope there is another version.
>
> regards
> zak


  • Prev by Date: Replacement gyrations
  • Next by Date: Miscellaneous'WorldPlot'
  • Previous by thread: Re: extracting decimal digits of Pi
  • Next by thread: Re: extracting decimal digits of Pi