OFFSET
0,3
COMMENTS
?(x) is Minkowski's question mark function. Note ?(x)-x is odd and has period 1. Finding the maximum of ?(x)-x difficult; fractal local maxima abound. Given that this continued fraction expansion represents the real a, we note the global minimum of ?(x)-x occurs (symmetrically across x=1/2) at 1-a (mod 1). We expect even entries will remain near (if not at) 1 and odd entries will grow very slowly (perhaps not monotonically).
A lookahead algorithm scanning over continued fractions with coefficients <= 20 and lookahead depth 4 returns the fraction [0; 1, 3, 1, 4, 1, 4, 1, 5, 1, 4, 1, 4, 1, 4, 1, 4, ..]. This corresponds to an x value of 0.7928941486060[1], at which point ?(x)-x is equal to 0.1425907067997[2]. - Charlie Neder, Oct 27 2018
LINKS
EXAMPLE
a = [0;1,3,1,4,..?..]
PROG
(Python)
from itertools import product
def qx(arr): #given continued fraction,
qx = 0
for i in range(1, len(arr)): #generate ?(x)/2
qx += (-1)**(i+1) / 2**sum(arr[:i+1])
ratio = arr[-1]
for i in range(len(arr)-2, -1, -1): #generate x
ratio = arr[i] + 1/ratio
return 2*qx - ratio, ratio #subtract
arr = [0, 1]
for k in range(1, 19):
cap = [0, ()] #current best branch
for tag in product(range(1, 21), repeat=4):
res = qx(arr + list(tag)) #test a branch, record if best
if res[0] > cap[0]: cap = [res[0], tag, res[1]]
print(cap) #print current ?(x)-x, best branch, current x
arr.append(cap[1][0]) #go down the branch
# Charlie Neder, Oct 27 2018
CROSSREFS
KEYWORD
cofr,hard,more,nonn
AUTHOR
Joseph Biberstine (jrbibers(AT)indiana.edu), Jun 13 2006
STATUS
approved