Regular paperfolding numbers

edit · history · discussion · files · short url · automatic sequences radix expansion special values number theory
Numbers
$b$ 
$P_b$
2:
0.8507361882018672603677977605320666044113994930827106477281682610318301584593194453485459826421939240
3:
0.4611261671004802273730563870907002921754226201988736114658856999501505363412175775145710958455859608
4:
0.3174028548685339270344644271987332710780661597493773143948349276984968251259861120152126493088605907
5:
0.2419231752273390509439538893142171775109123689428353656785417661491443772244379918100664125193104287
6:
0.1953453614241332214628407965352947210783446384410076563344005527532242703321116915327543896103025317
7:
0.1637415000665256287042260602515460104547150555933329387980249832557393400088748949139587272669626945
8:
0.1408997261914959896233291191379572386064373366886515816243585509090548029995100092084525153642353571
9:
0.1236261671004802273730563870907002921754226201988736114658856999501505363412175775145710958455859608
10:
0.1101100111001001110110001100100111011001110010001101100011001001110110011100100111011000110010001101
11:
0.09924806940553010285733020243491279682435243635639829097753655325176866682186149934944824958935243581
12:
0.09033002439778692135131514362975967752014579877854671616314019325530242324516524304344679115859242146
13:
0.08287794408424999271864904500437854727441657246138914532544243076285923869056731866716381037194815134
14:
0.07655850313917253518289995464700133548232935666384541755900653637004641309593224075656783879142809654
15:
0.07113218148789023269437344280048472899287339273273907145862872304581060226175959108295521669940572453
16:
0.06642246271167118193642521151245876127414459112192633400267806495339878591029983750540872774023313968
Definition
For an integer radix $b\geq2$, the regular paperfolding number is $P_b=\sum_{n=1}^{\infty} f_n b^{-n}$. Writing $n=2^j u$ with $u$ odd, its digit is $f_n=1$ for $u\equiv1\pmod4$ and $f_n=0$ for $u\equiv3\pmod4$ [1].
Parameters
$b$
—   integer radix ($b\geq2$)
Formulas
(1)
For $n\geq0$, $f_{4n+1}=1$ and $f_{4n+3}=0$; for $n\geq1$, $f_{2n}=f_n$ [1], Section 2.
(2)
Let $F(z)=\sum_{n=1}^{\infty}f_nz^n$ for $|z|<1$. Then $\displaystyle F(z)=F(z^2)+\frac{z}{1-z^4}$ and $\displaystyle P_b=F(1/b)=\sum_{j=0}^{\infty}\frac{b^{-2^j}}{1-b^{-4\cdot2^j}}$ [1], equations (1)-(2). The digit sum begins at $n=1$ and the grouped sum begins at $j=0$.
(3)
For every integer $b\geq2$, $\displaystyle P_b=P_{b^2}+\frac{b^3}{b^4-1}$.
(4)
For $N\geq1$, put $S_N=\sum_{n=1}^{N}f_n b^{-n}$. Then $\displaystyle 0\leq P_b-S_N\leq\frac{b^{-N}}{b-1}$, by the geometric majorant with all remaining digits equal to $1$.
(5)
For $J\geq1$, put $G_J=\sum_{j=0}^{J-1}b^{-2^j}/(1-b^{-4\cdot2^j})$. Then $\displaystyle 0\leq P_b-G_J=F(b^{-2^J})\leq\frac{1}{b^{2^J}-1}$.
Comments
(6)
The regular all-up-fold sequence codes valleys by $1$ and ridges by $0$; it begins $1101100111001001\ldots$ [1], Section 1. Its first digit has weight $b^{-1}$: $P_b=0.1101100111001001\ldots{}_b$, where the subscript denotes radix $b$. The stored numerical values are decimal enclosures.
(7)
The digit sequence is $2$-automatic: a finite automaton reads the binary representation of the index to produce each digit [1], Figure 2. This automaton base $2$ is distinct from the expansion radix $b$.
(8)
Its prefixes may also be constructed from the empty word by repeatedly replacing a word $w$ with $w\,1\,\operatorname{rev}(\overline w)$, where $\overline w$ interchanges digits $0$ and $1$ and $\operatorname{rev}$ reverses their order. This recursion gives the same odd-part digit rule.
Programs
(P1)
Sage
import numberdb.sage as numberdb
from sage.rings.integer_ring import ZZ
from sage.rings.rational_field import QQ
from sage.rings.real_arb import RealBallField

def paperfolding_number(b, digits=100):
    b = ZZ(b)
    if b < 2:
        raise ValueError("b must be an integer >= 2")
    s, m = QQ(0), ZZ(1)
    goal = QQ(1)/(ZZ(10)**(digits+30)*b)
    tail = QQ(1)/(b**m-1)
    while tail > goal:
        s += QQ(b**(3*m))/(b**(4*m)-1)
        m *= 2
        tail = QQ(1)/(b**m-1)
    R = RealBallField(numberdb.bits(digits, losing=120))
    return R(s+tail/2).add_error(R(tail/2))

paperfolding_number(2)
References
[1]
M. Coons and P. Vrbik, An Irrationality Measure for Regular Paperfolding Numbers, Journal of Integer Sequences 15 (2012), Article 12.1.6.
Links
Similar tables
Liouville reals in integer bases —   Liouville reals place unit digits at factorial positions. Regular paperfolding numbers instead use the digits of a $2$-automatic word in the same integer-radix construction.
Thue-Morse constants in integer bases —   Thue-Morse uses binary digit-sum parity starting at index zero; regular paperfolding uses the odd-part rule starting at index one. Both read the first digit in the first fractional position of the chosen integer radix.
Data properties
Entries are of type: real number
Table is complete: no (it holds every integer radix $2\leq b\leq16$, a contiguous reference prefix including binary, ternary, octal, decimal and hexadecimal and the intervening radices; $16$ is a noncanonical coverage cutoff and larger integer radices are equally valid)
How they were obtained:

The generator sums the grouped series with exact Sage rationals. After $J$ terms it bounds the omitted part by $1/(b^{2^J}-1)$, stopping when this is at most $10^{-130}/b$ for the default $100$ significant digits. Conversion of the rational midpoint and half-width to a $453$-bit Arb ball includes rounding and truncation error. Every returned ball is finite and has positive radius. The default range uses $7$ to $9$ grouped terms.

more

A separate checker constructs the digits by recursive folding, evaluates exact rational digit sums and bounds their tails by $b^{-N}/(b-1)$. For every stored base, this narrower interval is contained in the interval encoded by the recorded decimal. It also checks the functional equation at $b$ and $b^2$, verifies $1023$ digits against the odd-part rule, and uses a known digit prefix and deliberately incorrect shifts, omitted terms, altered last places, nonfinite inputs and excessively wide intervals as controls. The attached evidence records the exact tail widths, precision, code and software versions. These are computational checks of the stated enclosures, not a proof of further arithmetic properties.