OFFSET
0,3
COMMENTS
REFERENCES
Jean-Paul Allouche and Jeffrey Shallit, The Ubiquitous Prouhet-Thue-Morse Sequence, in C. Ding, T. Helleseth, N. Niederreiter (eds.), Sequences and their Applications: Proceedings of SETA '98, Springer-Verlag, London, 1999, pp. 1-16.
Michael Trott, Exercises of The Mathematica GuideBook for Numerics, Chapter 2, p. 33.
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..12
Michael Trott, Mathematica Guidebooks, Sample Exercises Numerics p. 33.
Donald R. Woods, David Robbins and Gustaf Gripenberg, Solution to Problem E2692, American Mathematical Monthly, Vol. 86, No. 5 (May 1979), pp. 394-395.
FORMULA
f(n) = Product_{k=0..2^(n-1)-1} ((2k+1)/(2k+2))^((-1)^tm(k)), where tm(k) is the Thue-Morse sequence A010060.
EXAMPLE
f(3): 1*4*6*7/(2*3*5*8) = 7/10, hence a(3) = 7.
f(5): 1*4*6*7*10*11*13*16*18*19*21*24*25*28*30*31 / (2*3*5*8*9*12*14*15*17*20*22*23*26*27*29*32) = 144305 / 204102 = 0.707024..., hence a(5) = 144305.
Sequence of fractions f(n) begin: 1/1, 1/2, 2/3, 7/10, 286/405, 144305/204102, ...
MAPLE
g:= (i, j)-> `if`(j=0, i, g(i, j-1)/g(i+2^(j-1), j-1)):
a:= n-> numer(g(1, n)):
seq(a(n), n=0..10); # Alois P. Heinz, Aug 08 2017
MATHEMATICA
f[1] = id[1]/id[2]; f[n_] := f[n] = f[n-1]/(f[n-1] /. id[k_] :> id[k + 2^(n-1)]); a[n_]:= f[n] /. id -> Identity // Numerator; Array[a, 8]
PROG
(Python)
from sympy.core.cache import cacheit
from sympy import numer, Rational
@cacheit
def g(i, j): return Rational(i) if j==0 else g(i, j - 1)/g(i + 2**(j - 1), j - 1)
def a(n): return numer(g(1, n))
print([a(n) for n in range(11)]) # Indranil Ghosh, Aug 09 2017, after Maple code
CROSSREFS
KEYWORD
nonn,frac
AUTHOR
Jean-François Alcover, Aug 08 2017
STATUS
approved