# Conjectured formula for the Fabius function

The Fabius function is the unique function $$F:R→[−1,1]{\bf F}:\mathbb R\to[-1, 1]$$ satisfying the following conditions:

• a functional–integral equation$$\require{action} \require{enclose}{^{\texttip{\dagger}{a poet or philosopher could say “it knows and replays its own future”}}}\require{action} \require{enclose}{^{\texttip{\dagger}{a poet or philosopher could say "it knows and replays its own future"}}}$$ $$\displaystyle{\bf F}(x)={\small\int_0^{2{\tiny\text{ }}x}}{\bf F}\left(t\right)dt,\,\displaystyle{\bf F}(x)={\small\int_0^{2{\tiny\text{ }}x}}{\bf F}\left(t\right)dt,\,$$ and
• a normalization condition $${\bf F}(1)=1.{\bf F}(1)=1.$$

It is noteworthy that despite being smooth (class $$C^\inftyC^\infty$$)$${^{\texttip{\dagger}{i.e. continuous and having continuous derivatives of any order}}}{^{\texttip{\dagger}{i.e. continuous and having continuous derivatives of any order}}}$$ everywhere, $${\bf F}(x){\bf F}(x)$$ is not real-analytic at any point $$x\ge0x\ge0$$ — its Taylor series there is either divergent, or a polynomial with a finite number of terms.$${^{\texttip{\dagger}{the latter happens at dyadic rational points}}}{^{\texttip{\dagger}{the latter happens at dyadic rational points}}}$$

Unlike some other functions that appear specifically constructed for that purpose, the Fabius function naturally occurs in research of several seemingly unrelated problems — perhaps, this is why it has been discovered and re-discovered independently many times by several mathematicians. It also has some practical applications in computational mathematics.

The Fabius function $${\bf F}(x){\bf F}(x)$$ is constant $$00$$ for all $$x\le0,x\le0,$$ but some authors prefer to define it only on $$[0,\infty)[0,\infty)$$ or only on $$[0,1].[0,1].$$ Some authors study a very closely related Rvachev$${^{\texttip{\dagger}{also variously spelled as Rvachëv or Rvachyov, a.k.a. “atomic function”}}}{^{\texttip{\dagger}{also variously spelled as Rvachëv or Rvachyov, a.k.a. "atomic function"}}}$$ function $$\operatorname{up}(x)\operatorname{up}(x)$$ defined as $$\operatorname{up}(x) = {\bf F}(x+1)\operatorname{up}(x) = {\bf F}(x+1)$$ for $$-1\le x\le1-1\le x\le1$$ and $$\operatorname{up}(x) = 0\operatorname{up}(x) = 0$$ otherwise.

It is known that the Fabius function assumes rational values at dyadic rational arguments — efficient algorithms to compute those values have been published or posted online, and have been discussed on this site.$$^{[1]}^{[1]}$$$$\!^{[2]}\!^{[2]}$$$$\!^{[3]}\!^{[3]}$$$$\!^{[4]}\!^{[4]}$$$$\!^{[5]}\!^{[5]}$$$$\!^{[6]}\!^{[6]}$$$$\!^{[7]}\!^{[7]}$$$$\!^{[8]}\!^{[8]}$$$$\!^{[9]}\!^{[9]}$$

I have been looking for a non-recursive, self-contained formula for the Fabius function for quite a long time. After lots of experimentation and looking for patterns in its values I came up with a conjectured empirical formula. Let$${^{\texttip{\dagger}{the superscript 𝑚 is just an index here, not to be confused with a power}}}{^{\texttip{\dagger}{the superscript 𝑚 is just an index here, not to be confused with a power}}}$$
$$\mathscr F^m_n = \frac1{2^{n^2}\left(\frac12;{\tiny\text{ }}\frac12\right)_n}\,\sum _{k=0}^n\frac{\binom n k_{1/2}}{2^{{\tiny\text{ }}k{\tiny\text{ }}(k-1)}(n+k)!}\,\sum _{\ell=0}^{2^k{\tiny\text{ }}m-1}\,(-1)^{s_2\left(\ell\right)}\,\left(\ell-2^km+\tfrac12\right)^{n+k}{\small,}\tag{\small\spadesuit}\mathscr F^m_n = \frac1{2^{n^2}\left(\frac12;{\tiny\text{ }}\frac12\right)_n}\,\sum _{k=0}^n\frac{\binom n k_{1/2}}{2^{{\tiny\text{ }}k{\tiny\text{ }}(k-1)}(n+k)!}\,\sum _{\ell=0}^{2^k{\tiny\text{ }}m-1}\,(-1)^{s_2\left(\ell\right)}\,\left(\ell-2^km+\tfrac12\right)^{n+k}{\small,}\tag{\small\spadesuit}$$
where $$k,\,\ell,\,m,\,nk,\,\ell,\,m,\,n$$ are non-negative integers, $$\displaystyle\small\left(a;{\tiny\text{ }}q\right)_n=\prod_{k=0}^{n-1} (1-a{\tiny\text{ }}q^k)\displaystyle\small\left(a;{\tiny\text{ }}q\right)_n=\prod_{k=0}^{n-1} (1-a{\tiny\text{ }}q^k)$$ is the q-Pochhammer symbol$${^{\texttip{\dagger}{it assumes only rational values in this formula}}}{^{\texttip{\dagger}{it assumes only rational values in this formula}}}$$, $${\binom n k}_q=\displaystyle\small\frac{\left(q;{\tiny\text{ }}q\right)_n}{\left(q;{\tiny\text{ }}q\right)_k\left(q;{\tiny\text{ }}q\right)_{n-k}}\vphantom{\Huge|}{\binom n k}_q=\displaystyle\small\frac{\left(q;{\tiny\text{ }}q\right)_n}{\left(q;{\tiny\text{ }}q\right)_k\left(q;{\tiny\text{ }}q\right)_{n-k}}\vphantom{\Huge|}$$ is the q-binomial coefficient$${^{\texttip{\dagger}{it assumes only rational values in this formula}}}{^{\texttip{\dagger}{it assumes only rational values in this formula}}}$$, and $$s_2(n)\vphantom{\Huge|}s_2(n)\vphantom{\Huge|}$$ is the sum of binary digits$${^{\texttip{\dagger}{i.e. the number of 1’s in the base-2 representation}}}{^{\texttip{\dagger}{i.e. the number of 1's in the base-2 representation}}}$$ of $$nn$$ (note that $$(-1)^{s_2\left(n\right)} = t_n\vphantom{\Huge|}(-1)^{s_2\left(n\right)} = t_n\vphantom{\Huge|}$$ is just the signed version of the Thue–Morse sequence, satisfying recurrence $$t_0 = 1,\,t_n = (-1)^n \, t_{\lfloor n/2\rfloor};\vphantom{\Huge|}t_0 = 1,\,t_n = (-1)^n \, t_{\lfloor n/2\rfloor};\vphantom{\Huge|}$$ see also$${^{[10]}}{^{[10]}}$$$${\!^{[11]}}{\!^{[11]}}$$$${\!^{[12]}}{\!^{[12]}}$$).

I conjecture that for all non-negative integers $$m,\,n,m,\,n,$$ the following identity holds:
$${\bf F}\!\left({\small\frac m{2^n}}\right)=\mathscr F^m_n.\tag{\small\diamondsuit}{\bf F}\!\left({\small\frac m{2^n}}\right)=\mathscr F^m_n.\tag{\small\diamondsuit}$$
Note that there is no requirement for $$\frac m{2^n}\frac m{2^n}$$ to be a proper irreducible fraction — it might well be that $$mm$$ is even, or $$m>2^nm>2^n$$. I have not been able to rigorously prove it yet, but it produces exact rational values that agree with those computed using known correct algorithms for all dyadic rational arguments I have tried. Of course, this formula did not just appear out of the blue — its structure was inspired by known algorithms, and it went a long way to this relatively concise form (at some point it had about $$55$$ levels of nested summations/products).

• Can we prove that $$\small(\diamondsuit)\small(\diamondsuit)$$ is indeed a correct representation of the Fabius function at dyadic rationals?
• If the conjecture is difficult to tackle at once, we can try to at least prove that the function defined by $$\small(\spadesuit)\small(\spadesuit)$$ shares some known properties with the Fabius function, e.g.:
• $$0\le\mathscr F^m_n\le1,0\le\mathscr F^m_n\le1,$$
• $$\mathscr F^m_n = \mathscr F^{2{\tiny\text{ }}m}_{n+1}\vphantom{\Large|}\mathscr F^m_n = \mathscr F^{2{\tiny\text{ }}m}_{n+1}\vphantom{\Large|}$$ — the result is the same across all representations of a rational number $$\frac m{2^n}\frac m{2^n}$$,
• $$\mathscr F^m_n = 1-\mathscr F^{(2^n-m)}_n\vphantom{\Large|}\mathscr F^m_n = 1-\mathscr F^{(2^n-m)}_n\vphantom{\Large|}$$ for all $$\small0\le m\le2^{n}\small0\le m\le2^{n}$$ — rotation symmetry,
• $$\mathscr F^m_n = \mathscr F^{(2^{n+1}-m)}_n\vphantom{\Large|}\mathscr F^m_n = \mathscr F^{(2^{n+1}-m)}_n\vphantom{\Large|}$$ for all $$\small0\le m\le2^{n+1}\small0\le m\le2^{n+1}$$ — reflection symmetry,
• for a fixed $$n,n,$$ and $$\small0\le m\le2^n\small0\le m\le2^n$$ the values of $$\mathscr F^m_n\vphantom{\Large|}\mathscr F^m_n\vphantom{\Large|}$$ strictly increase,
• all points $$\small\left(\frac m{2^n},\,\mathscr F^m_n\right)\vphantom{\Large|}\small\left(\frac m{2^n},\,\mathscr F^m_n\right)\vphantom{\Large|}$$ lie on a continuous curve — for any convergent sequence of dyadic rationals $$\frac m{2^n}\vphantom{\Large|}\frac m{2^n}\vphantom{\Large|}$$, the sequence of corresponding values $$\mathscr F^m_n\vphantom{\Large|}\mathscr F^m_n\vphantom{\Large|}$$ also converges.

If the conjecture $$\small(\diamondsuit)\small(\diamondsuit)$$ it true, then for all $$0\le x\le10\le x\le1$$ (not necessary rational)
$${\bf F}\!\left(x\right)=\lim_{n\to\infty}\,\frac1{2^{n^2}\left(\frac12;{\tiny\text{ }}\frac12\right)_n}\,\sum _{k=0}^n\frac{\binom n k_{1/2}}{2^{{\tiny\text{ }}k{\tiny\text{ }}(k-1)}(n+k)!}\,\sum _{\ell=0}^{\left\lfloor2^{n+k}{\tiny\text{ }}x-1\right\rfloor}\,(-1)^{s_2\left(\ell\right)}\,\left(\ell-2^{n+k}{\tiny\text{ }}x+\tfrac12\right)^{n+k}.\tag{\small\heartsuit}{\bf F}\!\left(x\right)=\lim_{n\to\infty}\,\frac1{2^{n^2}\left(\frac12;{\tiny\text{ }}\frac12\right)_n}\,\sum _{k=0}^n\frac{\binom n k_{1/2}}{2^{{\tiny\text{ }}k{\tiny\text{ }}(k-1)}(n+k)!}\,\sum _{\ell=0}^{\left\lfloor2^{n+k}{\tiny\text{ }}x-1\right\rfloor}\,(-1)^{s_2\left(\ell\right)}\,\left(\ell-2^{n+k}{\tiny\text{ }}x+\tfrac12\right)^{n+k}.\tag{\small\heartsuit}$$
For dyadic rational $$xx$$ the limit is trivial, because the sequence under the limit becomes constant for large enough $$nn$$. Also, there is a known series (by Rvachev) that expresses values of the Fabius function for all $$0\le x\le10\le x\le1$$ via its values at negative powers of $$22$$:
$${\bf F}\!\left(x\right)=\sum _{n=1}^\infty\frac{(-1)^{\left\lfloor 2^n{\tiny\text{ }}x\right\rfloor }-1}{2}\,(-1)^{s_2\left(\lfloor2^n{\tiny\text{ }}x\rfloor\right)}\;\sum_{k=0}^n\frac{2^{\frac{k{\tiny\text{ }}(k+1)}2}}{k!}\,\left(x-2^{-n}\left\lfloor 2^n{\tiny\text{ }}x\right\rfloor\right)^k\;{\bf F}\!\left(2^{{\tiny\text{ }}k-n}\right).\tag{\small\clubsuit}{\bf F}\!\left(x\right)=\sum _{n=1}^\infty\frac{(-1)^{\left\lfloor 2^n{\tiny\text{ }}x\right\rfloor }-1}{2}\,(-1)^{s_2\left(\lfloor2^n{\tiny\text{ }}x\rfloor\right)}\;\sum_{k=0}^n\frac{2^{\frac{k{\tiny\text{ }}(k+1)}2}}{k!}\,\left(x-2^{-n}\left\lfloor 2^n{\tiny\text{ }}x\right\rfloor\right)^k\;{\bf F}\!\left(2^{{\tiny\text{ }}k-n}\right).\tag{\small\clubsuit}$$
Again, for dyadic rational $$xx$$ this series terminates after a finite number of terms, producing an exact rational value.

In this answer, whereas the conjectured formula will not be confirmed so far, a simpler non-recursive, explicit formula for the Fabius function will be offered, which is expressed in terms similar to, but simpler than, those in the conjectured formula.

As noted in the Wikipedia article on the Fabius function, on the interval $$I:=[0,1]I:=[0,1]$$ the Fabius function coincides with the cumulative distribution function (cdf) of
$$\sum_{j=1}^\infty 2^{-j}U_j,\sum_{j=1}^\infty 2^{-j}U_j,$$
where the $$U_jU_j$$‘s are independent random variables uniformly distributed on $$II$$. So, for each $$x\in Ix\in I$$
$$F(x)=\lim_{n\to\infty} F_n(x),\tag{1}F(x)=\lim_{n\to\infty} F_n(x),\tag{1}$$
where $$F_nF_n$$ is the cdf of $$\sum_{j=1}^n 2^{-j}U_j\sum_{j=1}^n 2^{-j}U_j$$.

Next (see e.g. formula (2.2)), for any real $$xx$$
$$F_n(x)=\text{vol}_n(I^n\cap H_{n;c^{(n)},x}) =\frac1{n!\prod_1^n c_i}\,\sum_{\vp\in\{0,1\}^n}(-1)^{|\vp|}\, \big(x-c^{(n)}\cdot\vp\big)_+^n, $$F_n(x)=\text{vol}_n(I^n\cap H_{n;c^{(n)},x}) =\frac1{n!\prod_1^n c_i}\,\sum_{\vp\in\{0,1\}^n}(-1)^{|\vp|}\, \big(x-c^{(n)}\cdot\vp\big)_+^n,$$$$
where $$\text{vol}_n\text{vol}_n$$ is the Lebesgue measure on $$\mathbb R^n\mathbb R^n$$, $$H_{n;b,x}:=\{v\in\mathbb R^n\colon b\cdot v\le x\}H_{n;b,x}:=\{v\in\mathbb R^n\colon b\cdot v\le x\}$$, $$c^{(n)}:=(c_1,\dots,c_n)c^{(n)}:=(c_1,\dots,c_n)$$, $$c_j:=2^{-j}c_j:=2^{-j}$$, $$|\vp|:=\vp_1+\dots+\vp_n|\vp|:=\vp_1+\dots+\vp_n$$, $$\cdot\cdot$$ denotes the dot product, and $$t_+^n:=\max(0,t)^nt_+^n:=\max(0,t)^n$$. So, for $$x\in Ix\in I$$
$$F_n(x)=\frac{2^{n(n+1)/2}}{n!}\,\sum_{y\in D_{n,x}}(-1)^{s(y)}\, \big(x-y\big)^n, \tag{2} $$F_n(x)=\frac{2^{n(n+1)/2}}{n!}\,\sum_{y\in D_{n,x}}(-1)^{s(y)}\, \big(x-y\big)^n, \tag{2}$$$$
where $$D_{n,x}D_{n,x}$$ is the set of all dyadic numbers in $$[0,x][0,x]$$ of the form $$m2^{-n}m2^{-n}$$ for integers $$mm$$, and $$s(y)s(y)$$ is the sum of the binary digits of $$yy$$.

So, this answer consists of formulas (1) and (2).

Some of the differences between (1)–(2) and the conjectured formula are as follows:

• The main conjectured formula for $$F(x)F(x)$$ is stated only for dyadic numbers $$xx$$, and then extended to all values of $$xx$$ by the continuity of $$FF$$.
• The expression in the OP for $$F(x)F(x)$$ for dyadic $$xx$$ contains a double summation and a number of $$qq$$-Pochhammer symbols (I have had no experience with those symbols).

N.B.: this answer is cross-posted, with some edits, from MathOverflow.