(* Cf. the numerators of Out[339], below*)
hilbert[t_] :=
piecewiserecursivefractal[t, Identity, {Min[4, 1 + Floor[4*#]]} &,
{1 - 4*# &, 4*# - 1 &, 4*# - 2 &, 4 - 4*# &},
{I*(1 - #)/2 &, (I + #)/2 &, (I + 1 + #)/2 &, 1 + #*I/2 &}]
(* E.g., hilbert[1/2] {1/2 + I/2} *)
unbert[z_] :=
piecewiserecursivefractal[z, Identity,
If[0 <= Re[#] <= 1 && 0 <= Im[#] <= 1,
Range[4], {}] &,
{1 - 2*#/I &, 2*# - I &, 2*# - I - 1 &, (# - 1)*2/I &},
{(1 - #)/4 &, (# + 1)/4 &, (# + 2)/4 &, 1 - #/4 &}]
(* unbert[1/2 + I/2] {1/6, 1/2, 5/6} a triple point: hilbert/@% {{1/2 + I/2}, {1/2 + I/2}, {1/2 + I/2}} *)
ClearAll[piecewiserecursivefractal];
piecewiserecursivefractal[x_, f_, which_, iters_, fns_] :=
CheckAbort[
Check[piecewiserecursivefractal[x, g_, which, iters,
fns] = ((piecewiserecursivefractal[x, h_, which, iters, fns] :=
Block[{y}, y /. Solve[f[y] == h[y], y]]);
Union @@ ((fns[[#]] /@
piecewiserecursivefractal[iters[[#]][x],
Composition[f, fns[[#]]], which, iters, fns]) & /@
which[x])),
Abort[], {$RecursionLimit::reclim, $RecursionLimit::reclim2}],
piecewiserecursivefractal[x, g_, which, iters, fns] =.; Abort[]]
(* For a simpler but less bulletproof version, see the MATHEMATICA section of A260482 *)
In[338]:= unbert /@ (1/2 + I Range[1/32, 15/32, 1/16])
Out[338]= {{257/3072, 259/3072, 2813/3072, 2815/3072},
{269/3072, 271/3072, 2801/3072, 2803/3072},
{305/3072, 307/3072, 2765/3072, 2767/3072},
{317/3072, 319/3072, 2753/3072, 2755/3072},
{449/3072, 451/3072, 2621/3072, 2623/3072},
{461/3072, 463/3072, 2609/3072, 2611/3072},
{497/3072, 499/3072, 2573/3072, 2575/3072},
{509/3072, 511/3072, 2561/3072, 2563/3072}}
In[339]:= Differences@%
Out[339]= {{1/256, 1/256, -1/256, -1/256},
{3/256, 3/256, -3/256, -3/256},
{1/256, 1/256, -1/256, -1/256},
{11/256, 11/256, -11/256, -11/256},
{1/256, 1/256, -1/256, -1/256},
{3/256, 3/256, -3/256, -3/256},
{1/256, 1/256, -1/256, -1/256}}
(* Check that %338[[1]] is a quadruple point *)
In[340]:= hilbert /@ %%[[1]]
Out[340]= {{1/2 + I/32}, {1/2 + I/32}, {1/2 + I/32}, {1/2 + I/32}}
In[341]:= Select[Range[0, 1, 1/512], Length[unbert[# + I/2] > 3] &]
Out[341]= {}
(* I.e., there aren't any quadruple points on the horizontal bisector of the unit square! Other such horizontal and vertical lines of dyadic rationals intersect a dense set of quadruple points. *)
a[n_] := (2^(2*IntegerExponent[n, 2]+1) + 1)/3; Array[a, 100] (* Amiram Eldar, Dec 18 2023 *)
Comments