MathGroup Archive 1999

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

Search the Archive

Continued Fractions of Chap

  • To: mathgroup at smc.vnet.net
  • Subject: [mg17144] Continued Fractions of Chap
  • From: Wouter Meeussen <eu000949 at pophost.eunet.be>
  • Date: Sat, 17 Apr 1999 03:35:27 -0400
  • Sender: owner-wri-mathgroup at wolfram.com

it is a frequent error to expect high precision output from low precision input.

<<NumberTheory`ContinuedFractions`

Define 
chap[n_]:=
  Fold[10 #1+#2&,0,z=Flatten[Table[IntegerDigits[k],{k,n}]]]/10^Length[z]

this gives infinite precision to a n-integers-approximation of the Chap
constant. 

Now look how much precision we need in the input in order to get the first
24 convergents correct :
the 18 th convergent is good for 166 digits, plus the 6 of the fourth plus
18 times 1 gives 190 digits.
Below you can see what happens with less than that : GIGO (Garbage In,
Garbage Out)

List@@ContinuedFraction[chap[32],24]
{{0,8,9,1,149083,1,1,1,4,1,1,1,3,4,1,1,1,15,124884216720572938814101975705773,
    1,2,1,1,2}}

List@@ContinuedFraction[chap[64],24]
{{0,8,9,1,149083,1,1,1,4,1,1,1,3,4,1,1,1,15,
    63412308925238092611013868335374258496092121344018814685707353843030058258\
7905788839928245167712,2,38,1,17,1}}

List@@ContinuedFraction[chap[128],24]
{{0,8,9,1,149083,1,1,1,4,1,1,1,3,4,1,1,1,15,
    45754011139103107648364662824295611859960393971045755500066200439309026265\
925631493795314282889028203764596042155066397420654818003626098811871578451205\
22912438388198,2,2,2,2,1}}

List@@ContinuedFraction[chap[256],24]
{{0,8,9,1,149083,1,1,1,4,1,1,1,3,4,1,1,1,15,
    45754011139103107648364662824295611859960393971045755500066200439309026265\
925631493795320774712865631386412093755035520946071830899845758014698631488335\
92141783010987,6,1,1,21,1}}

List@@ContinuedFraction[chap[512],24]
{{0,8,9,1,149083,1,1,1,4,1,1,1,3,4,1,1,1,15,
    45754011139103107648364662824295611859960393971045755500066200439309026265\
925631493795320774712865631386412093755035520946071830899845758014698631488335\
92141783010987,6,1,1,21,1}} so the chap[256] is good enough as input.

And, finally, yes, Mathematica can do it in a few seconds :
with chap[3600] or 13293 digits input, you can get to the 128 th convergent :

List@@ContinuedFraction[chap[3600],128]


{{0,8,9,1,149083,1,1,1,4,1,1,1,3,4,1,1,1,15,
    45754011139103107648364662824295611859960393971045755500066200439309026265\
925631493795320774712865631386412093755035520946071830899845758014698631488335\
92141783010987,6,1,1,21,1,9,1,1,2,3,1,7,2,1,83,1,156,4,58,8,54,
    44573538009111788339590676716342937884372929580963249471885567000678776593\
245839308378747999................boring.....................................
.....936476862326017635113172423,2,3,1,3,1,2,14,1,1,1,1,1,2,3,1,2,155,1,1,1,
1,7,6,
    1,4,8,4,2,1,11,1,1,1,8,2,30,1,3,6,2,6,7,1,2,3,2,1,2,7,1,2,5,2,6,1,4,2,1,7,
    1,978672080794824383097693966787098584725156169851537045233767856374064894\
30692260503029827384487615893885870400899915964301331839296944867434,7,72,1,1,
    13,1,4,1,6,2,1,268,1,1,40,1,5,1,6,1,1,4,1,12,3,1}}

the number of digits in these monsters is (initial zero dropped) :
1+Floor[Log[10,#]]&/@Rest[First[%]]

{1,1,1,6,1,1,1,1,1,1,1,1,1,1,1,1,2,166,1,1,1,2,1,1,1,1,1,1,1,1,1,1,2,1,3,1,2,
  1,2,2504,1,1,1,1,1,1,2,1,1,1,1,1,1,1,1,1,3,1,1,1,1,1,1,1,1,1,1,1,1,2,1,1,1,
  1,1,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,140,1,2,1,1,2,1,1,1,1,
  1,1,3,1,1,2,1,1,1,1,1,1,1,1,2,1,1}

Plus@@%
    2957
and that's less than 13293, so we're on safe ground.

Given that 

Fold[#2+1/#1&,1, Reverse[{0,8,9,1,149083,1,1,1,4,1,1,1,3,4,1,1,1,15,
        4575401113910310764836466282429561185996039397104575550006620043930902\
626592563149379532077471286563138641209375503552094607183089984575801469863148\
833592141783010987}]]~N~356

reverses the CF to :

0.1234567891011121314151617181920212223242526272829303132333435363738394041424\
344454647484950515253545556575859606162636465666768697071727374757677787980818\
283848586878889909192939495969798991001011021031041051061071081091101111121131\
141151161171181191201211221231241251261271281291301311321331341351361371381391\
4014114214314414514614714814915015115215315432
                                            ^^
we have a positive check. 
But hey, 354 digits output precision from 189 digits input! 
My guesses must have been far off?

enjoy,

wouter.

Dr. Wouter L. J. MEEUSSEN
w.meeussen.vdmcc at vandemoortele.be
eu000949 at pophost.eunet.be



  • Prev by Date: RE: Border on Tables
  • Next by Date: Re: BesselJZeros problem/bug?
  • Previous by thread: Re: psfix in 3.02?
  • Next by thread: Step functions