Skip to content

Instantly share code, notes, and snippets.

@VladimirReshetnikov
Created April 27, 2016 22:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save VladimirReshetnikov/cb205c1826e2fb78a785fa193f03eaba to your computer and use it in GitHub Desktop.
Save VladimirReshetnikov/cb205c1826e2fb78a785fa193f03eaba to your computer and use it in GitHub Desktop.
FabiusApproximant[n_, x_] := (2^(-1 + (1/2)*n*(3 + n))*((-2 + x)^(1 + n)
+ (-x)^(1 + n) - (1 + (-1)^n)*(1 - x)^(1 + n)
- Sum[(-1)^(n + ThueMorse[k])*(1 + (-1)^IntegerExponent[k, 2])*((1 + k/2^n - x)^(1 + n)
+ (-1 + k/2^n + x)^n*Abs[-1 + k/2^n + x]), {k, 1, 2^n}]))/(n + 1)!
@olekravchenko
Copy link

Atomic up(x) one could define as

Fa[x_] := If[0 <= x <= 1, FabiusApproximant[5, x], 0];
up[x_] := 2 Piecewise[{
    {Fa[2 x], 0 <= x <= 1/2},
    {1 - Fa[2 x - 1], 1/2 <= x <= 1}
    }]

which is first prime of Fabius function as well

d1Fa[x_] := D[FabiusApproximant[5, x], x] // Evaluate

(*Plot Fa[x], up[x], Fa[x]'*)
Plot[{Fa[x], up[x], d1Fa[x]}, {x, 0, 1}, ImageSize -> Large, 
 PlotStyle -> {Thick, Thin, Dashed}]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment