Global maximum of ?(x)-x
Joseph Biberstine
jrbibers at indiana.edu
Tue Jun 13 10:17:37 CEST 2006
Gerald McGarvey wrote:
> Another question is: Where does []x - x have a global maximum?,
> where []x is the Conway box function (the inverse of Minkowski's
> question mark function). Some info on []x is at
> http://en.wikipedia.org/wiki/Minkowski_question_mark_function
> (which answers my question about ?(1-x)+?(x)). I'm working on PARI
> code for []x.
>
> - Gerry
I finally stopped lazing about and wrote Conway's box for Mathematica.
Should work fine everywhere.
(* exact; for dyadic x *)
cbd[x_] := (y = Mod[x,1]; If[y == 0, x, d = RealDigits[y, 2]; nd =
Join[Table[0, {i, 0, -d[[2]]}], d[[1]]];
FromContinuedFraction[Join[{Floor[x]}, Length /@ Split[nd]]]]);
(* approx (change magic constant where marked as desired); for all x *)
cbn[x_] := (y = Mod[x, 1]; If[y == 0, x, d = RealDigits[y, 2,(*arb
precn*)200]; nd = Join[Table[0, {i, 0, -d[[2]]}], d[[1]]];
FromContinuedFraction[Join[{Floor[x]}, Length /@ Split[nd]]]]);
- Joseph Biberstine
More information about the SeqFan
mailing list