login
This site is supported by donations to The OEIS Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A007400 Continued fraction for sum(n>=0, 1/2^(2^n) ) = 0.8164215090218931... 20
0, 1, 4, 2, 4, 4, 6, 4, 2, 4, 6, 2, 4, 6, 4, 4, 2, 4, 6, 2, 4, 4, 6, 4, 2, 6, 4, 2, 4, 6, 4, 4, 2, 4, 6, 2, 4, 4, 6, 4, 2, 4, 6, 2, 4, 6, 4, 4, 2, 6, 4, 2, 4, 4, 6, 4, 2, 6, 4, 2, 4, 6, 4, 4, 2, 4, 6, 2, 4, 4, 6, 4, 2, 4, 6, 2, 4, 6, 4, 4, 2, 4, 6, 2, 4, 4, 6, 4, 2, 6, 4, 2, 4, 6, 4, 4, 2, 6, 4 (list; graph; refs; listen; history; text; internal format)
OFFSET

0,3

LINKS

Harry J. Smith, Table of n, a(n) for n = 0..20000

H. Cohn, Symmetry and specializability in continued fractions, arXiv:math/0008221 [math.NT], 2000.

Jeffrey Shallit, Simple continued fractions for some irrational numbers. J. Number Theory 11 (1979), no. 2, 209-217.

A. J. van der Poorten, An introduction to continued fractions

G. Xiao, Contfrac

Index entries for continued fractions for constants

FORMULA

From Ralf Stephan, May 17 2005: (Start)

a(0)=0, a(1)=1, a(2)=4; for n>2:

a(8k)    = a(8k+3)   = 2;

a(8k+4)  = a(8k+7)   = a(16k+5) = a(16k+14) = 4;

a(16k+6) = a(16k+13) = 6;

a(8k+1)  = a(4k+1);

a(8k+2)  = a(4k+2). (End)

EXAMPLE

0.816421509021893143708079737... = 0 + 1/(1 + 1/(4 + 1/(2 + 1/(4 + ...))))

MAPLE

a:= proc(n) option remember; local n8, n16;

    n8:= n mod 8;

    if n8 = 0 or n8 = 3 then return 2

    elif n8 = 4 or n8 = 7 then return 4

    elif n8 = 1 then return procname((n+1)/2)

    elif n8 = 2 then return procname((n+2)/2)

    fi;

    n16:= n mod 16;

    if n16 = 5 or n16 = 14 then return 4

    elif n16 = 6 or n16 = 13 then return 6

    fi

end proc:

a(0):= 0: a(1):= 1: a(2):= 4:

map(a, [$0..1000]); # Robert Israel, Jun 14 2016

MATHEMATICA

a[n_] := a[n] = Which[n < 3, {0, 1, 4}[[n+1]], Mod[n, 8] == 1, a[(n+1)/2], Mod[n, 8] == 2, a[(n+2)/2], True, {2, 0, 0, 2, 4, 4, 6, 4, 2, 0, 0, 2, 4, 6, 4, 4}[[Mod[n, 16]+1]]]; Table[a[n], {n, 0, 98}] (* Jean-Fran├žois Alcover, Nov 29 2013, after Ralf Stephan *)

PROG

(PARI) a(n)=if(n<3, [0, 1, 4][n+1], if(n%8==1, a((n+1)/2), if(n%8==2, a((n+2)/2), [2, 0, 0, 2, 4, 4, 6, 4, 2, 0, 0, 2, 4, 6, 4, 4][(n%16)+1]))) /* Ralf Stephan */

(PARI) a(n)=contfrac(suminf(n=0, 1/2^(2^n)))[n+1]

(PARI) { allocatemem(932245000); default(realprecision, 26000); x=suminf(n=0, 1/2^(2^n)); x=contfrac(x); for (n=1, 20001, write("b007400.txt", n-1, " ", x[n])); } \\ Harry J. Smith, May 07 2009

CROSSREFS

Cf. A007404, A073414, A073415, A089267.

Sequence in context: A179411 A103859 A253808 * A057696 A057697 A019921

Adjacent sequences:  A007397 A007398 A007399 * A007401 A007402 A007403

KEYWORD

nonn,cofr

AUTHOR

Simon Plouffe, Jeffrey Shallit

STATUS

approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Transforms | Superseeker | Recent | More pages
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy .

Last modified September 27 11:34 EDT 2016. Contains 276596 sequences.