generate.py

back to table · edit · history · where entries came from · files · download

2184 bytes, as of the version from 2026-12-01 14:15 (current). Recorded here, not run.

"""T893: Backhouse's constant, positive coefficient-growth convention.

Install: sage -pip install numberdb
Place generate.py and backhouse_math.py in the same directory.
  sage -python generate.py                  # compute a certified enclosure
  sage -python generate.py --verify         # read-only reproducibility check
  sage -python generate.py --publish        # fill an authorized existing draft

The constant has no parameters: enumerate() yields one empty mapping.
The return is a RealBall, with no redundant symbol/id annotation. Computation
uses 512-bit Arb arithmetic and 1024 prime terms at the default 100 digits,
exact-rational sign bisection and an explicit quadratic-coefficient tail.
See proof.md and the attached complete-arc zero-count certificate for the
root's identity, simplicity and dominance. These certificates are mathematical
evidence, not an independent review verdict. check_coefficients.py uses a
separate exact reciprocal-coefficient construction. Credentials and session
attribution are supplied by the caller, never embedded here.
"""
import os,sys
import numberdb.sage as numberdb
from numberdb._write import to_text
from backhouse_math import root_certificate

class Backhouse(numberdb.Generator):
    table='T893'
    parameters=()
    type='R'
    digits=100
    rigour='proven'
    files=('generate.py','backhouse_math.py','proof.md','argument-selection.md',
           'check_coefficients.py','compute.py','computation.json',
           'root-certificate.json','coefficient-check.json',
           'flajolet-1995.txt','skill-manifest.json')
    def enumerate(self):
        yield {}
    def value(self,params,digits):
        if params: raise ValueError('Backhouse\'s constant has no input parameter')
        return root_certificate(digits)[0]

if __name__=='__main__':
    if os.environ.get('NUMBERDB_KEY_FROM_STDIN')=='1':
        numberdb.configure(api_key=sys.stdin.read().strip())
    g=Backhouse()
    if '--publish' in sys.argv or os.environ.get('NUMBERDB_PUBLISH')=='1':
        print(g.publish())
    elif '--verify' in sys.argv:
        print(g.verify(sample=None))
    else:
        print(to_text(g.value({},g.digits),g.digits))