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!)
A094964 A continued fraction transformation of Pi. 3

%I

%S 3,8,2,8,6,5,6,1,6,2,0,5,1,1,7,6,3,4,9,2,1,6,8,0,7,8,5,8,1,2,3,2,7,1,

%T 5,3,8,3,4,1,3,8,0,6,0,0,7,6,7,2,4,7,4,6,7,8,8,4,6,4,8,6,7,7,0,9,9,4,

%U 9,4,2,0,3,6,6,3,5,2,0,7,5,2,6,0,3,7,1,1,5,0,4,1,8,0,7,0,0,9,2,7,6,8,0,0,4

%N A continued fraction transformation of Pi.

%C The number, C, has the continued fraction which is the decimal expansion of Pi.

%e C = 3.828656162...

%t RealDigits[ FromContinuedFraction[ RealDigits[Pi, 10, 125][[1]]], 10, 111][[1]]

%o (PARI) extractDigits(x,{basis=10}) = { local(d); d=[floor(x)]; x = basis*(x - floor(x)); for (i=1,ceil(precision(x)*log(10)/log(basis))+5, d = concat(d, floor(x)); x = basis*(x - floor(x)); ); return(d); }

%o continuedFraction(digs) = { local(rtn,n,first); rtn = 0; for (i=0,#digs-1, n = digs[ #digs - i]; if (n, first = i; rtn = n; break; ); ); for (i=first+1,#digs-1, rtn = digs[ #digs - i] + 1/rtn; ); return(rtn); }

%o \p 1000

%o continuedFraction(extractDigits(Pi,10))+0. \\ Olivier Favre (of.olivier.favre(AT)gmail.com), Mar 01 2010

%Y Cf. A000796.

%K cons,easy,nonn,base

%O 1,1

%A _Robert G. Wilson v_, May 26 2004

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 July 24 23:25 EDT 2021. Contains 346273 sequences. (Running on oeis4.)